Package org.apache.ws.commons.schema

Examples of org.apache.ws.commons.schema.XmlSchemaExternal


            XmlSchemaObjectCollection includes = schema.getIncludes();
            for (int j = 0; j < includes.getCount(); j++) {
                Object item = includes.getItem(j);
                if (item instanceof XmlSchemaExternal) {
                    //recursively call the name adjusting
                    XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal) item;
                    XmlSchema s = xmlSchemaExternal.getSchema();
                    if (s != null) {
                        adjustSchemaNames(Arrays.asList(
                                new XmlSchema[]{s}), nameTable);
                        xmlSchemaExternal.setSchemaLocation(
                                customSchemaNamePrefix == null ?
                                        //use the default mode
                                        (getName() +
                                                "?xsd=" +
                                                nameTable.get(s)) :
View Full Code Here


                SchemaImpl schemaImpl = new SchemaImpl();
                schemaImpl.setRequired(true);
                schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA);
                schemaImpl.setElement(schemaInfo.getElement());
                for (int x = 0; x < schemaInfo.getSchema().getIncludes().getCount(); x++) {
                    XmlSchemaExternal ext = (XmlSchemaExternal)schemaInfo.getSchema()
                        .getIncludes().getItem(x);
                    if (ext.getSchema() == null) {
                        continue;
                    }
                    if (ext instanceof XmlSchemaImport) {
                        SchemaImport imp = schemaImpl.createImport();
                        imp.setNamespaceURI(((XmlSchemaImport)ext).getNamespace());
                        imp.setSchemaLocationURI(((XmlSchemaImport)ext).getSchemaLocation());
                       
                        SchemaImpl schemaImpl2 = new SchemaImpl();
                        schemaImpl2.setRequired(true);
                        schemaImpl2.setElementType(WSDLConstants.QNAME_SCHEMA);
                        schemaImpl2.setDocumentBaseURI(ext.getSchema().getSourceURI());
                        try {
                            schemaImpl2.setElement(ext.getSchema().getSchemaDocument().getDocumentElement());
                        } catch (XmlSchemaSerializerException e) {
                            //ignore
                        }
                        imp.setReferencedSchema(schemaImpl2);

                        schemaImpl.addImport(imp);
                    } else if (ext instanceof XmlSchemaInclude) {
                        SchemaReference imp = schemaImpl.createInclude();
                        imp.setSchemaLocationURI(((XmlSchemaInclude)ext).getSchemaLocation());

                        SchemaImpl schemaImpl2 = new SchemaImpl();
                        schemaImpl2.setRequired(true);
                        schemaImpl2.setElementType(WSDLConstants.QNAME_SCHEMA);
                        schemaImpl2.setDocumentBaseURI(ext.getSchema().getSourceURI());
                        try {
                            schemaImpl2.setElement(ext.getSchema().getSchemaDocument().getDocumentElement());
                        } catch (XmlSchemaSerializerException e) {
                            //ignore
                        }
                        imp.setReferencedSchema(schemaImpl2);
                       
                        schemaImpl.addInclude(imp);
                    } else if (ext instanceof XmlSchemaRedefine) {
                        SchemaReference imp = schemaImpl.createRedefine();
                        imp.setSchemaLocationURI(((XmlSchemaRedefine)ext).getSchemaLocation());
                       
                        SchemaImpl schemaImpl2 = new SchemaImpl();
                        schemaImpl2.setRequired(true);
                        schemaImpl2.setElementType(WSDLConstants.QNAME_SCHEMA);
                        schemaImpl2.setDocumentBaseURI(ext.getSchema().getSourceURI());
                        try {
                            schemaImpl2.setElement(ext.getSchema().getSchemaDocument().getDocumentElement());
                        } catch (XmlSchemaSerializerException e) {
                            //ignore
                        }
                        imp.setReferencedSchema(schemaImpl2);
                       
View Full Code Here

    private XmlSchema getSchema(XmlSchema parentSchema, String name) {
        for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) {
            Object obj = iter.next();
            if (obj instanceof XmlSchemaExternal) {
                XmlSchemaExternal extSchema = (XmlSchemaExternal)obj;
                if (extSchema.getSchemaLocation().endsWith(name)) {
                    return extSchema.getSchema();
                } else {
                    XmlSchema schema = getSchema(extSchema.getSchema(), name);
                    if (schema != null) {
                        return schema;
                    }
                }
            }
View Full Code Here

            if (uri.equals(schema.getTargetNamespace())) {
                return schema.getElementFormDefault().getValue().equals(XmlSchemaForm.QUALIFIED);
            }
            Iterator it = schema.getIncludes().getIterator();
            while (it.hasNext()) {
                XmlSchemaExternal extSchema = (XmlSchemaExternal) it.next();
                return isElementFormQualified(extSchema.getSchema(), type);
            }
        }
        return false;
    }
View Full Code Here

               
            Iterator schemas = xmlSchemaTypes.getIncludes().getIterator();
            while (schemas.hasNext()) {
                Object obj = schemas.next();
                if (obj instanceof XmlSchemaExternal) {
                    XmlSchemaExternal extSchema = (XmlSchemaExternal) obj;                
                    addCorbaTypes(extSchema.getSchema());
                    // REVISIT: This was preventing certain types from being added to the corba
                    // typemap even when they are referenced from other parts of the wsdl.
                    //
                    // Should this add the corba types if it IS an instance of the XmlSchemaImport
                    // (and not an XmlSchemaInclude or XmlSchemaRedefine)?
View Full Code Here

            XmlSchemaObjectCollection includes = xmlSchema.getIncludes();
            Iterator includeIter = includes.getIterator();
            while (includeIter.hasNext()) {
                Object obj = includeIter.next();
                if (obj instanceof XmlSchemaExternal) {
                    XmlSchemaExternal extSchema = (XmlSchemaExternal) obj;
                    if (extSchema instanceof XmlSchemaImport) {
                        XmlSchemaImport xmlImport = (XmlSchemaImport) obj;
                        if (xmlImport.getNamespace().equals(typeName.getNamespaceURI())) {
                            XmlSchema importSchema = xmlImport.getSchema();
                            schemaType = importSchema.getTypeByName(typeName);
                        }
                    } else {
                        schemaType = findSchemaType(extSchema.getSchema(), typeName);
                        if (schemaType != null) {
                            return schemaType;
                        }
                    }                   
                }                               
View Full Code Here

            if (xmlSchema.getIncludes() != null) {
                Iterator schemas = xmlSchema.getIncludes().getIterator();
                while (schemas.hasNext()) {
                    Object obj = schemas.next();
                    if (obj instanceof XmlSchemaExternal) {
                        XmlSchemaExternal extSchema = (XmlSchemaExternal) obj;
                        if (!(extSchema instanceof XmlSchemaImport)) {
                            schemaElement = findElement(extSchema.getSchema(), elName);
                            if (schemaElement != null) {
                                return schemaElement;
                            }
                        }
                    }
View Full Code Here

            if (xmlSchema.getIncludes() != null) {
                Iterator schemas = xmlSchema.getIncludes().getIterator();
                while (schemas.hasNext()) {
                    Object obj = schemas.next();
                    if (obj instanceof XmlSchemaExternal) {
                        XmlSchemaExternal extSchema = (XmlSchemaExternal) obj;
                        if (!(extSchema instanceof XmlSchemaImport)) {
                            schemaType = findTypeInSchema(extSchema.getSchema(), typeName);
                            if (schemaType != null) {
                                return schemaType;
                            }
                        }
                    }
View Full Code Here

            for (int j = 0; j < includes.getCount(); j++) {
                Object item = includes.getItem(j);
                XmlSchema s;
                if (item instanceof XmlSchemaExternal) {
                    XmlSchemaExternal externalSchema = (XmlSchemaExternal) item;
                    s = externalSchema.getSchema();
                    if (s != null && nameTable.get(s) == null) {
                        //insert the name into the table
                        insertIntoNameTable(nameTable, s);
                        //recursively call the same procedure
                        calcualteSchemaNames(Arrays.asList(
View Full Code Here

                                  Hashtable importedScheams) {
        XmlSchemaObjectCollection includes = parentSchema.getIncludes();
        for (int j = 0; j < includes.getCount(); j++) {
            Object item = includes.getItem(j);
            if (item instanceof XmlSchemaExternal) {
                XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal) item;
                XmlSchema s = xmlSchemaExternal.getSchema();
                adjustSchemaLocation(s, xmlSchemaExternal, nameTable, importedScheams);
            }
        }

    }
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.schema.XmlSchemaExternal

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.