Package org.apache.ws.commons.schema

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


    private void addImport(XmlSchema schema, String ns) {
        if (!ns.equals(schema.getTargetNamespace())
            && !ns.equals(WSDLConstants.NS_SCHEMA_XSD)
            && !isExistImport(schema, ns)) {
            XmlSchemaImport is = new XmlSchemaImport();
            is.setNamespace(ns);
            if (this.schemaLocationMapping.get(ns) != null) {
                is.setSchemaLocation(this.schemaLocationMapping.get(ns));
            }
            schema.getItems().add(is);
        }
    }
View Full Code Here


        boolean isExist = false;

        for (Iterator ite = schema.getItems().getIterator(); ite.hasNext();) {
            XmlSchemaObject obj = (XmlSchemaObject)ite.next();
            if (obj instanceof XmlSchemaImport) {
                XmlSchemaImport xsImport = (XmlSchemaImport)obj;
                if (xsImport.getNamespace().equals(ns)) {
                    isExist = true;
                    break;
                }
            }
        }
View Full Code Here

    private void findImports(XmlSchema schema, Set<XmlSchema> processedImports, Set<XmlSchema> processedIncludes) {
        processedImports.add(schema);
        List<XmlSchemaExternal> externals = schema.getExternals();
        for (XmlSchemaExternal external : externals) {
            if (external instanceof XmlSchemaImport) {
                XmlSchemaImport schemaImport = (XmlSchemaImport) external;
                XmlSchema importedSchema = schemaImport.getSchema();
                if (!"http://www.w3.org/XML/1998/namespace".equals(schemaImport.getNamespace()) &&
                        importedSchema != null && !processedImports.contains(importedSchema)) {
                    inlineIncludes(importedSchema, processedIncludes, processedImports);
                    findImports(importedSchema, processedImports, processedIncludes);
                    xmlSchemas.add(importedSchema);
                }
View Full Code Here

    private void addImport(XmlSchema schema, String ns) {
        if (!ns.equals(schema.getTargetNamespace())
            && !ns.equals(WSDLConstants.NS_SCHEMA_XSD)
            && !isExistImport(schema, ns)) {
            XmlSchemaImport is = new XmlSchemaImport(schema);
            is.setNamespace(ns);
            if (this.schemaLocationMapping.get(ns) != null) {
                is.setSchemaLocation(this.schemaLocationMapping.get(ns));
            }
            if (!schema.getItems().contains(is)) {
                schema.getItems().add(is);
            }
        }
View Full Code Here

    private boolean isExistImport(XmlSchema schema, String ns) {
        boolean isExist = false;

        for (XmlSchemaExternal ext : schema.getExternals()) {
            if (ext instanceof XmlSchemaImport) {
                XmlSchemaImport xsImport = (XmlSchemaImport)ext;
                if (xsImport.getNamespace().equals(ns)) {
                    isExist = true;
                    break;
                }
            }
        }
View Full Code Here

    private void addImport(XmlSchema schema, String ns) {
        if (!ns.equals(schema.getTargetNamespace())
            && !ns.equals(WSDLConstants.NU_SCHEMA_XSD)
            && !isExistImport(schema, ns)) {
           
            XmlSchemaImport is = new XmlSchemaImport();
            is.setNamespace(ns);
            schema.getItems().add(is);
        }
    }
View Full Code Here

        boolean isExist = false;

        for (Iterator ite = schema.getItems().getIterator(); ite.hasNext();) {
            XmlSchemaObject obj = (XmlSchemaObject)ite.next();
            if (obj instanceof XmlSchemaImport) {
                XmlSchemaImport xsImport = (XmlSchemaImport)obj;
                if (xsImport.getNamespace().equals(ns)) {
                    isExist = true;
                    break;
                }
            }
        }
View Full Code Here

    private void addImport(XmlSchema schema, String ns) {
        if (!ns.equals(schema.getTargetNamespace())
            && !ns.equals(WSDLConstants.NS_SCHEMA_XSD)
            && !isExistImport(schema, ns)) {
            XmlSchemaImport is = new XmlSchemaImport();
            is.setNamespace(ns);
            if (this.schemaLocationMapping.get(ns) != null) {
                is.setSchemaLocation(this.schemaLocationMapping.get(ns));
            }
            schema.getItems().add(is);
        }
    }
View Full Code Here

        boolean isExist = false;

        for (Iterator ite = schema.getItems().getIterator(); ite.hasNext();) {
            XmlSchemaObject obj = (XmlSchemaObject)ite.next();
            if (obj instanceof XmlSchemaImport) {
                XmlSchemaImport xsImport = (XmlSchemaImport)obj;
                if (xsImport.getNamespace().equals(ns)) {
                    isExist = true;
                    break;
                }
            }
        }
View Full Code Here

    private void addWSAddressingImport(XmlSchema s) {
        boolean alreadyImported = false;
        for (Iterator i = s.getIncludes().getIterator(); i.hasNext();) {
            java.lang.Object o = i.next();
            if (o instanceof XmlSchemaImport) {
                XmlSchemaImport schemaImport = (XmlSchemaImport)o;
                if (schemaImport.getNamespace().equals(ReferenceConstants.WSADDRESSING_NAMESPACE)) {
                    alreadyImported = true;
                    break;
                }
            }
        }
       
        if (!alreadyImported) {
            // We need to add an import statement to include the WS addressing types
            XmlSchemaImport wsaImport = new XmlSchemaImport();
            wsaImport.setNamespace(ReferenceConstants.WSADDRESSING_NAMESPACE);
            wsaImport.setSchemaLocation(ReferenceConstants.WSADDRESSING_LOCATION);
            s.getItems().add(wsaImport);
            s.getIncludes().add(wsaImport);
        }
       
        // Add the addressing namespace to the WSDLs list of namespaces.
View Full Code Here

TOP

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

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.