Package org.eclipse.xsd

Examples of org.eclipse.xsd.XSDSchema


        Parser parser = new Parser(configuration);
        SimpleFeatureCollection fc = (SimpleFeatureCollection) parser.parse(TestConfiguration.class
                .getResourceAsStream("test.xml"));
        assertNotNull(fc);

        XSDSchema schema = TEST.getInstance().getSchema();
        assertNotNull(schema);

        Encoder encoder = new Encoder(configuration, schema);
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        encoder.write(fc, TEST.TestFeatureCollection, output);
View Full Code Here


        Parser parser = new Parser(configuration);
        SimpleFeatureCollection fc = (SimpleFeatureCollection) parser.parse(TestConfiguration.class
                .getResourceAsStream("test.xml"));
        assertNotNull(fc);

        XSDSchema schema = TEST.getInstance().getSchema();
        assertNotNull(schema);

        Encoder encoder = new Encoder(configuration, schema);

        ByteArrayOutputStream output = new ByteArrayOutputStream();
View Full Code Here

        return getClass().getResource("gml.xsd").toString();
    }
   
    @Override
    protected XSDSchema buildSchema() throws IOException {
        XSDSchema schema =  super.buildSchema();
       
        schema.resolveElementDeclaration(NAMESPACE, "_Feature").eAdapters()
            .add(new SubstitutionGroupLeakPreventer());
        schema.eAdapters().add(new ReferencingDirectiveLeakPreventer());
        return schema;
    }
View Full Code Here

    }

    @Test
    public void testParseDescribeFeatureType() throws Exception {
        String loc = getClass().getResource("geoserver-DescribeFeatureType.xml").getFile();
        XSDSchema schema = Schemas.parse(loc);

        assertNotNull(schema);
        final String targetNs = "http://cite.opengeospatial.org/gmlsf";
        final String featureName = "PrimitiveGeoFeature";
        QName name = new QName(targetNs, featureName);
View Full Code Here

    protected Collection find(Class c) {
        ArrayList found = new ArrayList();

        for (int i = 0; i < schemas.length; i++) {
            XSDSchema schema = schemas[i];

            List content = schema.getContents();

            for (Iterator itr = content.iterator(); itr.hasNext();) {
                Object o = itr.next();

                if (c.isAssignableFrom(o.getClass())) {
View Full Code Here

    protected void buildElementIndex() {
        elementIndex = new HashMap();

        for (int i = 0; i < schemas.length; i++) {
            XSDSchema schema = schemas[i];

            for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext();) {
                XSDElementDeclaration element = (XSDElementDeclaration) e.next();

                QName qName = new QName(element.getTargetNamespace(), element.getName());
                elementIndex.put(qName, element);
            }
View Full Code Here

    protected void buildAttriubuteIndex() {
        attributeIndex = new HashMap();

        for (int i = 0; i < schemas.length; i++) {
            XSDSchema schema = schemas[i];

            for (Iterator a = schema.getAttributeDeclarations().iterator(); a.hasNext();) {
                XSDAttributeDeclaration attribute = (XSDAttributeDeclaration) a.next();

                QName qName = new QName(attribute.getTargetNamespace(), attribute.getName());
                attributeIndex.put(qName, attribute);
            }
View Full Code Here

    protected void buildAttributeGroupIndex() {
        attributeGroupIndex = new HashMap();

        for (int i = 0; i < schemas.length; i++) {
            XSDSchema schema = schemas[i];

            for (Iterator g = schema.getAttributeGroupDefinitions().iterator(); g.hasNext();) {
                XSDAttributeGroupDefinition group = (XSDAttributeGroupDefinition) g.next();

                QName qName = new QName(group.getTargetNamespace(), group.getName());
                attributeGroupIndex.put(qName, group);
            }
View Full Code Here

    protected void buildComplexTypeIndex() {
        complexTypeIndex = new HashMap();

        for (int i = 0; i < schemas.length; i++) {
            XSDSchema schema = schemas[i];

            for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext();) {
                XSDTypeDefinition type = (XSDTypeDefinition) t.next();

                if (type instanceof XSDComplexTypeDefinition) {
                    QName qName = new QName(type.getTargetNamespace(), type.getName());
                    complexTypeIndex.put(qName, type);
View Full Code Here

    protected void buildSimpleTypeIndex() {
        simpleTypeIndex = new HashMap();

        for (int i = 0; i < schemas.length; i++) {
            XSDSchema schema = schemas[i];

            for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext();) {
                XSDTypeDefinition type = (XSDTypeDefinition) t.next();

                if (type instanceof XSDSimpleTypeDefinition) {
                    QName qName = new QName(type.getTargetNamespace(), type.getName());
                    simpleTypeIndex.put(qName, type);
View Full Code Here

TOP

Related Classes of org.eclipse.xsd.XSDSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.