com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants Java Examples

The following examples show how to use com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WsimportOptions.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Exposing it as a public method to allow external tools such as NB to read from wsdl model and work on it.
 * TODO: WSDL model needs to be exposed - basically at tool time we need to use the runtimw wsdl model
 *
 * Binding files could be jaxws or jaxb. This method identifies jaxws and jaxb binding files and keeps them separately. jaxb binding files are given separately
 * to JAXB in {@link com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder}
 *
 * @param receiver {@link ErrorReceiver}
 */
public final void parseBindings(ErrorReceiver receiver){
    for (InputSource is : bindingFiles) {
        XMLStreamReader reader =
                XMLStreamReaderFactory.create(is,true);
        XMLStreamReaderUtil.nextElementContent(reader);
        if (reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)) {
            jaxwsCustomBindings.add(new RereadInputSource(is));
        } else if (reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS) ||
                reader.getName().equals(new QName(SchemaConstants.NS_XSD, "schema"))) {
            jaxbCustomBindings.add(new RereadInputSource(is));
        } else {
            LocatorImpl locator = new LocatorImpl();
            locator.setSystemId(reader.getLocation().getSystemId());
            locator.setPublicId(reader.getLocation().getPublicId());
            locator.setLineNumber(reader.getLocation().getLineNumber());
            locator.setColumnNumber(reader.getLocation().getColumnNumber());
            receiver.warning(locator, ConfigurationMessages.CONFIGURATION_NOT_BINDING_FILE(is.getSystemId()));
        }
    }
}
 
Example #2
Source File: WSDLInternalizationLogic.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
        protected String findExternalResource( String nsURI, String localName, Attributes atts) {
            if(WSDLConstants.NS_WSDL.equals(nsURI) && "import".equals(localName)){
//                if(parent.isExtensionMode()){
//                    //TODO: add support for importing schema using wsdl:import
//                }
                return atts.getValue("location");
            }

            // We don't need to do this anymore, JAXB handles the schema imports, includes etc., but this is useful for the clientJar option in
            // fetching  the imported schemas to package in the jar..
            if (parent.options.clientjar != null) {
                if (SchemaConstants.NS_XSD.equals(nsURI) && "import".equals(localName)) {
                    return atts.getValue("schemaLocation");
                }
            }
            return null;
        }
 
Example #3
Source File: WSDLParser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void validateSchemaImports(Element typesElement){
        for (Iterator iter = XmlUtil.getAllChildren(typesElement); iter.hasNext();) {
            Element e = Util.nextElement(iter);
            if (e == null) {
                break;
            }
            if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_IMPORT)) {
                errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.WARNING_WSI_R_2003());
            }else{
                checkNotWsdlElement(e);
//                if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_SCHEMA)) {
//                    forest.getInlinedSchemaElement().add(e);
//                }

            }
        }
    }
 
Example #4
Source File: WsimportOptions.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Exposing it as a public method to allow external tools such as NB to read from wsdl model and work on it.
 * TODO: WSDL model needs to be exposed - basically at tool time we need to use the runtimw wsdl model
 *
 * Binding files could be jaxws or jaxb. This method identifies jaxws and jaxb binding files and keeps them separately. jaxb binding files are given separately
 * to JAXB in {@link com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder}
 *
 * @param receiver {@link ErrorReceiver}
 */
public final void parseBindings(ErrorReceiver receiver){
    for (InputSource is : bindingFiles) {
        XMLStreamReader reader =
                XMLStreamReaderFactory.create(is,true);
        XMLStreamReaderUtil.nextElementContent(reader);
        if (reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)) {
            jaxwsCustomBindings.add(new RereadInputSource(is));
        } else if (reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS) ||
                reader.getName().equals(new QName(SchemaConstants.NS_XSD, "schema"))) {
            jaxbCustomBindings.add(new RereadInputSource(is));
        } else {
            LocatorImpl locator = new LocatorImpl();
            locator.setSystemId(reader.getLocation().getSystemId());
            locator.setPublicId(reader.getLocation().getPublicId());
            locator.setLineNumber(reader.getLocation().getLineNumber());
            locator.setColumnNumber(reader.getLocation().getColumnNumber());
            receiver.warning(locator, ConfigurationMessages.CONFIGURATION_NOT_BINDING_FILE(is.getSystemId()));
        }
    }
}
 
Example #5
Source File: WSDLInternalizationLogic.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@Override
        protected String findExternalResource( String nsURI, String localName, Attributes atts) {
            if(WSDLConstants.NS_WSDL.equals(nsURI) && "import".equals(localName)){
//                if(parent.isExtensionMode()){
//                    //TODO: add support for importing schema using wsdl:import
//                }
                return atts.getValue("location");
            }

            // We don't need to do this anymore, JAXB handles the schema imports, includes etc., but this is useful for the clientJar option in
            // fetching  the imported schemas to package in the jar..
            if (parent.options.clientjar != null) {
                if (SchemaConstants.NS_XSD.equals(nsURI) && "import".equals(localName)) {
                    return atts.getValue("schemaLocation");
                }
            }
            return null;
        }
 
Example #6
Source File: WSDLParser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void validateSchemaImports(Element typesElement){
        for (Iterator iter = XmlUtil.getAllChildren(typesElement); iter.hasNext();) {
            Element e = Util.nextElement(iter);
            if (e == null) {
                break;
            }
            if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_IMPORT)) {
                errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.WARNING_WSI_R_2003());
            }else{
                checkNotWsdlElement(e);
//                if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_SCHEMA)) {
//                    forest.getInlinedSchemaElement().add(e);
//                }

            }
        }
    }
 
Example #7
Source File: WsimportOptions.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Exposing it as a public method to allow external tools such as NB to read from wsdl model and work on it.
 * TODO: WSDL model needs to be exposed - basically at tool time we need to use the runtimw wsdl model
 *
 * Binding files could be jaxws or jaxb. This method identifies jaxws and jaxb binding files and keeps them separately. jaxb binding files are given separately
 * to JAXB in {@link com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder}
 *
 * @param receiver {@link ErrorReceiver}
 */
public final void parseBindings(ErrorReceiver receiver){
    for (InputSource is : bindingFiles) {
        XMLStreamReader reader =
                XMLStreamReaderFactory.create(is,true);
        XMLStreamReaderUtil.nextElementContent(reader);
        if (reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)) {
            jaxwsCustomBindings.add(new RereadInputSource(is));
        } else if (reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS) ||
                reader.getName().equals(new QName(SchemaConstants.NS_XSD, "schema"))) {
            jaxbCustomBindings.add(new RereadInputSource(is));
        } else {
            LocatorImpl locator = new LocatorImpl();
            locator.setSystemId(reader.getLocation().getSystemId());
            locator.setPublicId(reader.getLocation().getPublicId());
            locator.setLineNumber(reader.getLocation().getLineNumber());
            locator.setColumnNumber(reader.getLocation().getColumnNumber());
            receiver.warning(locator, ConfigurationMessages.CONFIGURATION_NOT_BINDING_FILE(is.getSystemId()));
        }
    }
}
 
Example #8
Source File: WSDLInternalizationLogic.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
        protected String findExternalResource( String nsURI, String localName, Attributes atts) {
            if(WSDLConstants.NS_WSDL.equals(nsURI) && "import".equals(localName)){
//                if(parent.isExtensionMode()){
//                    //TODO: add support for importing schema using wsdl:import
//                }
                return atts.getValue("location");
            }

            // We don't need to do this anymore, JAXB handles the schema imports, includes etc., but this is useful for the clientJar option in
            // fetching  the imported schemas to package in the jar..
            if (parent.options.clientjar != null) {
                if (SchemaConstants.NS_XSD.equals(nsURI) && "import".equals(localName)) {
                    return atts.getValue("schemaLocation");
                }
            }
            return null;
        }
 
Example #9
Source File: WSDLParser.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void validateSchemaImports(Element typesElement){
        for (Iterator iter = XmlUtil.getAllChildren(typesElement); iter.hasNext();) {
            Element e = Util.nextElement(iter);
            if (e == null) {
                break;
            }
            if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_IMPORT)) {
                errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.WARNING_WSI_R_2003());
            }else{
                checkNotWsdlElement(e);
//                if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_SCHEMA)) {
//                    forest.getInlinedSchemaElement().add(e);
//                }

            }
        }
    }
 
Example #10
Source File: WsimportOptions.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Exposing it as a public method to allow external tools such as NB to read from wsdl model and work on it.
 * TODO: WSDL model needs to be exposed - basically at tool time we need to use the runtimw wsdl model
 *
 * Binding files could be jaxws or jaxb. This method identifies jaxws and jaxb binding files and keeps them separately. jaxb binding files are given separately
 * to JAXB in {@link com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder}
 *
 * @param receiver {@link ErrorReceiver}
 */
public final void parseBindings(ErrorReceiver receiver){
    for (InputSource is : bindingFiles) {
        XMLStreamReader reader =
                XMLStreamReaderFactory.create(is,true);
        XMLStreamReaderUtil.nextElementContent(reader);
        if (reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)) {
            jaxwsCustomBindings.add(new RereadInputSource(is));
        } else if (reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS) ||
                reader.getName().equals(new QName(SchemaConstants.NS_XSD, "schema"))) {
            jaxbCustomBindings.add(new RereadInputSource(is));
        } else {
            LocatorImpl locator = new LocatorImpl();
            locator.setSystemId(reader.getLocation().getSystemId());
            locator.setPublicId(reader.getLocation().getPublicId());
            locator.setLineNumber(reader.getLocation().getLineNumber());
            locator.setColumnNumber(reader.getLocation().getColumnNumber());
            receiver.warning(locator, ConfigurationMessages.CONFIGURATION_NOT_BINDING_FILE(is.getSystemId()));
        }
    }
}
 
Example #11
Source File: WSDLInternalizationLogic.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
        protected String findExternalResource( String nsURI, String localName, Attributes atts) {
            if(WSDLConstants.NS_WSDL.equals(nsURI) && "import".equals(localName)){
//                if(parent.isExtensionMode()){
//                    //TODO: add support for importing schema using wsdl:import
//                }
                return atts.getValue("location");
            }

            // We don't need to do this anymore, JAXB handles the schema imports, includes etc., but this is useful for the clientJar option in
            // fetching  the imported schemas to package in the jar..
            if (parent.options.clientjar != null) {
                if (SchemaConstants.NS_XSD.equals(nsURI) && "import".equals(localName)) {
                    return atts.getValue("schemaLocation");
                }
            }
            return null;
        }
 
Example #12
Source File: WSDLParser.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void validateSchemaImports(Element typesElement){
        for (Iterator iter = XmlUtil.getAllChildren(typesElement); iter.hasNext();) {
            Element e = Util.nextElement(iter);
            if (e == null) {
                break;
            }
            if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_IMPORT)) {
                errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.WARNING_WSI_R_2003());
            }else{
                checkNotWsdlElement(e);
//                if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_SCHEMA)) {
//                    forest.getInlinedSchemaElement().add(e);
//                }

            }
        }
    }
 
Example #13
Source File: WsimportOptions.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Exposing it as a public method to allow external tools such as NB to read from wsdl model and work on it.
 * TODO: WSDL model needs to be exposed - basically at tool time we need to use the runtimw wsdl model
 *
 * Binding files could be jaxws or jaxb. This method identifies jaxws and jaxb binding files and keeps them separately. jaxb binding files are given separately
 * to JAXB in {@link com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder}
 *
 * @param receiver {@link ErrorReceiver}
 */
public final void parseBindings(ErrorReceiver receiver){
    for (InputSource is : bindingFiles) {
        XMLStreamReader reader =
                XMLStreamReaderFactory.create(is,true);
        XMLStreamReaderUtil.nextElementContent(reader);
        if (reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)) {
            jaxwsCustomBindings.add(new RereadInputSource(is));
        } else if (reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS) ||
                reader.getName().equals(new QName(SchemaConstants.NS_XSD, "schema"))) {
            jaxbCustomBindings.add(new RereadInputSource(is));
        } else {
            LocatorImpl locator = new LocatorImpl();
            locator.setSystemId(reader.getLocation().getSystemId());
            locator.setPublicId(reader.getLocation().getPublicId());
            locator.setLineNumber(reader.getLocation().getLineNumber());
            locator.setColumnNumber(reader.getLocation().getColumnNumber());
            receiver.warning(locator, ConfigurationMessages.CONFIGURATION_NOT_BINDING_FILE(is.getSystemId()));
        }
    }
}
 
Example #14
Source File: WSDLInternalizationLogic.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
        protected String findExternalResource( String nsURI, String localName, Attributes atts) {
            if(WSDLConstants.NS_WSDL.equals(nsURI) && "import".equals(localName)){
//                if(parent.isExtensionMode()){
//                    //TODO: add support for importing schema using wsdl:import
//                }
                return atts.getValue("location");
            }

            // We don't need to do this anymore, JAXB handles the schema imports, includes etc., but this is useful for the clientJar option in
            // fetching  the imported schemas to package in the jar..
            if (parent.options.clientjar != null) {
                if (SchemaConstants.NS_XSD.equals(nsURI) && "import".equals(localName)) {
                    return atts.getValue("schemaLocation");
                }
            }
            return null;
        }
 
Example #15
Source File: WSDLParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void validateSchemaImports(Element typesElement){
        for (Iterator iter = XmlUtil.getAllChildren(typesElement); iter.hasNext();) {
            Element e = Util.nextElement(iter);
            if (e == null) {
                break;
            }
            if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_IMPORT)) {
                errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.WARNING_WSI_R_2003());
            }else{
                checkNotWsdlElement(e);
//                if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_SCHEMA)) {
//                    forest.getInlinedSchemaElement().add(e);
//                }

            }
        }
    }
 
Example #16
Source File: WsimportOptions.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Exposing it as a public method to allow external tools such as NB to read from wsdl model and work on it.
 * TODO: WSDL model needs to be exposed - basically at tool time we need to use the runtimw wsdl model
 *
 * Binding files could be jaxws or jaxb. This method identifies jaxws and jaxb binding files and keeps them separately. jaxb binding files are given separately
 * to JAXB in {@link com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder}
 *
 * @param receiver {@link ErrorReceiver}
 */
public final void parseBindings(ErrorReceiver receiver){
    for (InputSource is : bindingFiles) {
        XMLStreamReader reader =
                XMLStreamReaderFactory.create(is,true);
        XMLStreamReaderUtil.nextElementContent(reader);
        if (reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)) {
            jaxwsCustomBindings.add(new RereadInputSource(is));
        } else if (reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS) ||
                reader.getName().equals(new QName(SchemaConstants.NS_XSD, "schema"))) {
            jaxbCustomBindings.add(new RereadInputSource(is));
        } else {
            LocatorImpl locator = new LocatorImpl();
            locator.setSystemId(reader.getLocation().getSystemId());
            locator.setPublicId(reader.getLocation().getPublicId());
            locator.setLineNumber(reader.getLocation().getLineNumber());
            locator.setColumnNumber(reader.getLocation().getColumnNumber());
            receiver.warning(locator, ConfigurationMessages.CONFIGURATION_NOT_BINDING_FILE(is.getSystemId()));
        }
    }
}
 
Example #17
Source File: WsimportOptions.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Exposing it as a public method to allow external tools such as NB to read from wsdl model and work on it.
 * TODO: WSDL model needs to be exposed - basically at tool time we need to use the runtimw wsdl model
 *
 * Binding files could be jaxws or jaxb. This method identifies jaxws and jaxb binding files and keeps them separately. jaxb binding files are given separately
 * to JAXB in {@link com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder}
 *
 * @param receiver {@link ErrorReceiver}
 */
public final void parseBindings(ErrorReceiver receiver){
    for (InputSource is : bindingFiles) {
        XMLStreamReader reader =
                XMLStreamReaderFactory.create(is,true);
        XMLStreamReaderUtil.nextElementContent(reader);
        if (reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)) {
            jaxwsCustomBindings.add(new RereadInputSource(is));
        } else if (reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS) ||
                reader.getName().equals(new QName(SchemaConstants.NS_XSD, "schema"))) {
            jaxbCustomBindings.add(new RereadInputSource(is));
        } else {
            LocatorImpl locator = new LocatorImpl();
            locator.setSystemId(reader.getLocation().getSystemId());
            locator.setPublicId(reader.getLocation().getPublicId());
            locator.setLineNumber(reader.getLocation().getLineNumber());
            locator.setColumnNumber(reader.getLocation().getColumnNumber());
            receiver.warning(locator, ConfigurationMessages.CONFIGURATION_NOT_BINDING_FILE(is.getSystemId()));
        }
    }
}
 
Example #18
Source File: WSDLInternalizationLogic.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
        protected String findExternalResource( String nsURI, String localName, Attributes atts) {
            if(WSDLConstants.NS_WSDL.equals(nsURI) && "import".equals(localName)){
//                if(parent.isExtensionMode()){
//                    //TODO: add support for importing schema using wsdl:import
//                }
                return atts.getValue("location");
            }

            // We don't need to do this anymore, JAXB handles the schema imports, includes etc., but this is useful for the clientJar option in
            // fetching  the imported schemas to package in the jar..
            if (parent.options.clientjar != null) {
                if (SchemaConstants.NS_XSD.equals(nsURI) && "import".equals(localName)) {
                    return atts.getValue("schemaLocation");
                }
            }
            return null;
        }
 
Example #19
Source File: WSDLParser.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void validateSchemaImports(Element typesElement){
        for (Iterator iter = XmlUtil.getAllChildren(typesElement); iter.hasNext();) {
            Element e = Util.nextElement(iter);
            if (e == null) {
                break;
            }
            if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_IMPORT)) {
                errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.WARNING_WSI_R_2003());
            }else{
                checkNotWsdlElement(e);
//                if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_SCHEMA)) {
//                    forest.getInlinedSchemaElement().add(e);
//                }

            }
        }
    }
 
Example #20
Source File: WSDLInternalizationLogic.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
        protected String findExternalResource( String nsURI, String localName, Attributes atts) {
            if(WSDLConstants.NS_WSDL.equals(nsURI) && "import".equals(localName)){
//                if(parent.isExtensionMode()){
//                    //TODO: add support for importing schema using wsdl:import
//                }
                return atts.getValue("location");
            }

            // We don't need to do this anymore, JAXB handles the schema imports, includes etc., but this is useful for the clientJar option in
            // fetching  the imported schemas to package in the jar..
            if (parent.options.clientjar != null) {
                if (SchemaConstants.NS_XSD.equals(nsURI) && "import".equals(localName)) {
                    return atts.getValue("schemaLocation");
                }
            }
            return null;
        }
 
Example #21
Source File: WsimportOptions.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Exposing it as a public method to allow external tools such as NB to read from wsdl model and work on it.
 * TODO: WSDL model needs to be exposed - basically at tool time we need to use the runtimw wsdl model
 *
 * Binding files could be jaxws or jaxb. This method identifies jaxws and jaxb binding files and keeps them separately. jaxb binding files are given separately
 * to JAXB in {@link com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder}
 *
 * @param receiver {@link ErrorReceiver}
 */
public final void parseBindings(ErrorReceiver receiver){
    for (InputSource is : bindingFiles) {
        XMLStreamReader reader =
                XMLStreamReaderFactory.create(is,true);
        XMLStreamReaderUtil.nextElementContent(reader);
        if (reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)) {
            jaxwsCustomBindings.add(new RereadInputSource(is));
        } else if (reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS) ||
                reader.getName().equals(new QName(SchemaConstants.NS_XSD, "schema"))) {
            jaxbCustomBindings.add(new RereadInputSource(is));
        } else {
            LocatorImpl locator = new LocatorImpl();
            locator.setSystemId(reader.getLocation().getSystemId());
            locator.setPublicId(reader.getLocation().getPublicId());
            locator.setLineNumber(reader.getLocation().getLineNumber());
            locator.setColumnNumber(reader.getLocation().getColumnNumber());
            receiver.warning(locator, ConfigurationMessages.CONFIGURATION_NOT_BINDING_FILE(is.getSystemId()));
        }
    }
}
 
Example #22
Source File: WSDLParser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void validateSchemaImports(Element typesElement){
        for (Iterator iter = XmlUtil.getAllChildren(typesElement); iter.hasNext();) {
            Element e = Util.nextElement(iter);
            if (e == null) {
                break;
            }
            if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_IMPORT)) {
                errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.WARNING_WSI_R_2003());
            }else{
                checkNotWsdlElement(e);
//                if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_SCHEMA)) {
//                    forest.getInlinedSchemaElement().add(e);
//                }

            }
        }
    }
 
Example #23
Source File: WSDLParser.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void validateSchemaImports(Element typesElement){
        for (Iterator iter = XmlUtil.getAllChildren(typesElement); iter.hasNext();) {
            Element e = Util.nextElement(iter);
            if (e == null) {
                break;
            }
            if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_IMPORT)) {
                errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.WARNING_WSI_R_2003());
            }else{
                checkNotWsdlElement(e);
//                if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_SCHEMA)) {
//                    forest.getInlinedSchemaElement().add(e);
//                }

            }
        }
    }
 
Example #24
Source File: WSDLInternalizationLogic.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
        protected String findExternalResource( String nsURI, String localName, Attributes atts) {
            if(WSDLConstants.NS_WSDL.equals(nsURI) && "import".equals(localName)){
//                if(parent.isExtensionMode()){
//                    //TODO: add support for importing schema using wsdl:import
//                }
                return atts.getValue("location");
            }

            // We don't need to do this anymore, JAXB handles the schema imports, includes etc., but this is useful for the clientJar option in
            // fetching  the imported schemas to package in the jar..
            if (parent.options.clientjar != null) {
                if (SchemaConstants.NS_XSD.equals(nsURI) && "import".equals(localName)) {
                    return atts.getValue("schemaLocation");
                }
            }
            return null;
        }
 
Example #25
Source File: DOMForest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses the given document and add it to the DOM forest.
 *
 * @return null if there was a parse error. otherwise non-null.
 */
private @NotNull Document parse(String systemId, InputSource inputSource, boolean root) throws SAXException, IOException{
    Document dom = documentBuilder.newDocument();

    systemId = normalizeSystemId(systemId);

    // put into the map before growing a tree, to
    // prevent recursive reference from causing infinite loop.
    core.put(systemId, dom);

    dom.setDocumentURI(systemId);
    if (root)
        rootDocuments.add(systemId);

    try {
        XMLReader reader = createReader(dom);

        InputStream is = null;
        if(inputSource.getByteStream() == null){
            inputSource = entityResolver.resolveEntity(null, systemId);
        }
        reader.parse(inputSource);
        Element doc = dom.getDocumentElement();
        if (doc == null) {
            return null;
        }
        NodeList schemas = doc.getElementsByTagNameNS(SchemaConstants.NS_XSD, "schema");
        for (int i = 0; i < schemas.getLength(); i++) {
            inlinedSchemaElements.add((Element) schemas.item(i));
        }
    } catch (ParserConfigurationException e) {
        errorReceiver.error(e);
        throw new SAXException(e.getMessage());
    }
    resolvedCache.put(systemId, dom.getDocumentURI());
    return dom;
}
 
Example #26
Source File: DOMForest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses the given document and add it to the DOM forest.
 *
 * @return null if there was a parse error. otherwise non-null.
 */
private @NotNull Document parse(String systemId, InputSource inputSource, boolean root) throws SAXException, IOException{
    Document dom = documentBuilder.newDocument();

    systemId = normalizeSystemId(systemId);

    // put into the map before growing a tree, to
    // prevent recursive reference from causing infinite loop.
    core.put(systemId, dom);

    dom.setDocumentURI(systemId);
    if (root)
        rootDocuments.add(systemId);

    try {
        XMLReader reader = createReader(dom);

        InputStream is = null;
        if(inputSource.getByteStream() == null){
            inputSource = entityResolver.resolveEntity(null, systemId);
        }
        reader.parse(inputSource);
        Element doc = dom.getDocumentElement();
        if (doc == null) {
            return null;
        }
        NodeList schemas = doc.getElementsByTagNameNS(SchemaConstants.NS_XSD, "schema");
        for (int i = 0; i < schemas.getLength(); i++) {
            inlinedSchemaElements.add((Element) schemas.item(i));
        }
    } catch (ParserConfigurationException e) {
        errorReceiver.error(e);
        throw new SAXException(e.getMessage());
    }
    resolvedCache.put(systemId, dom.getDocumentURI());
    return dom;
}
 
Example #27
Source File: DOMForest.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses the given document and add it to the DOM forest.
 *
 * @return null if there was a parse error. otherwise non-null.
 */
private @NotNull Document parse(String systemId, InputSource inputSource, boolean root) throws SAXException, IOException{
    Document dom = documentBuilder.newDocument();

    systemId = normalizeSystemId(systemId);

    // put into the map before growing a tree, to
    // prevent recursive reference from causing infinite loop.
    core.put(systemId, dom);

    dom.setDocumentURI(systemId);
    if (root)
        rootDocuments.add(systemId);

    try {
        XMLReader reader = createReader(dom);

        InputStream is = null;
        if(inputSource.getByteStream() == null){
            inputSource = entityResolver.resolveEntity(null, systemId);
        }
        reader.parse(inputSource);
        Element doc = dom.getDocumentElement();
        if (doc == null) {
            return null;
        }
        NodeList schemas = doc.getElementsByTagNameNS(SchemaConstants.NS_XSD, "schema");
        for (int i = 0; i < schemas.getLength(); i++) {
            inlinedSchemaElements.add((Element) schemas.item(i));
        }
    } catch (ParserConfigurationException e) {
        errorReceiver.error(e);
        throw new SAXException(e.getMessage());
    }
    resolvedCache.put(systemId, dom.getDocumentURI());
    return dom;
}
 
Example #28
Source File: DOMForest.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses the given document and add it to the DOM forest.
 *
 * @return null if there was a parse error. otherwise non-null.
 */
private @NotNull Document parse(String systemId, InputSource inputSource, boolean root) throws SAXException, IOException{
    Document dom = documentBuilder.newDocument();

    systemId = normalizeSystemId(systemId);

    // put into the map before growing a tree, to
    // prevent recursive reference from causing infinite loop.
    core.put(systemId, dom);

    dom.setDocumentURI(systemId);
    if (root)
        rootDocuments.add(systemId);

    try {
        XMLReader reader = createReader(dom);

        InputStream is = null;
        if(inputSource.getByteStream() == null){
            inputSource = entityResolver.resolveEntity(null, systemId);
        }
        reader.parse(inputSource);
        Element doc = dom.getDocumentElement();
        if (doc == null) {
            return null;
        }
        NodeList schemas = doc.getElementsByTagNameNS(SchemaConstants.NS_XSD, "schema");
        for (int i = 0; i < schemas.getLength(); i++) {
            inlinedSchemaElements.add((Element) schemas.item(i));
        }
    } catch (ParserConfigurationException e) {
        errorReceiver.error(e);
        throw new SAXException(e.getMessage());
    }
    resolvedCache.put(systemId, dom.getDocumentURI());
    return dom;
}
 
Example #29
Source File: DOMForest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses the given document and add it to the DOM forest.
 *
 * @return null if there was a parse error. otherwise non-null.
 */
private @NotNull Document parse(String systemId, InputSource inputSource, boolean root) throws SAXException, IOException{
    Document dom = documentBuilder.newDocument();

    systemId = normalizeSystemId(systemId);

    // put into the map before growing a tree, to
    // prevent recursive reference from causing infinite loop.
    core.put(systemId, dom);

    dom.setDocumentURI(systemId);
    if (root)
        rootDocuments.add(systemId);

    try {
        XMLReader reader = createReader(dom);

        InputStream is = null;
        if(inputSource.getByteStream() == null){
            inputSource = entityResolver.resolveEntity(null, systemId);
        }
        reader.parse(inputSource);
        Element doc = dom.getDocumentElement();
        if (doc == null) {
            return null;
        }
        NodeList schemas = doc.getElementsByTagNameNS(SchemaConstants.NS_XSD, "schema");
        for (int i = 0; i < schemas.getLength(); i++) {
            inlinedSchemaElements.add((Element) schemas.item(i));
        }
    } catch (ParserConfigurationException e) {
        errorReceiver.error(e);
        throw new SAXException(e.getMessage());
    }
    resolvedCache.put(systemId, dom.getDocumentURI());
    return dom;
}
 
Example #30
Source File: DOMForest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses the given document and add it to the DOM forest.
 *
 * @return null if there was a parse error. otherwise non-null.
 */
private @NotNull Document parse(String systemId, InputSource inputSource, boolean root) throws SAXException, IOException{
    Document dom = documentBuilder.newDocument();

    systemId = normalizeSystemId(systemId);

    // put into the map before growing a tree, to
    // prevent recursive reference from causing infinite loop.
    core.put(systemId, dom);

    dom.setDocumentURI(systemId);
    if (root)
        rootDocuments.add(systemId);

    try {
        XMLReader reader = createReader(dom);

        InputStream is = null;
        if(inputSource.getByteStream() == null){
            inputSource = entityResolver.resolveEntity(null, systemId);
        }
        reader.parse(inputSource);
        Element doc = dom.getDocumentElement();
        if (doc == null) {
            return null;
        }
        NodeList schemas = doc.getElementsByTagNameNS(SchemaConstants.NS_XSD, "schema");
        for (int i = 0; i < schemas.getLength(); i++) {
            inlinedSchemaElements.add((Element) schemas.item(i));
        }
    } catch (ParserConfigurationException e) {
        errorReceiver.error(e);
        throw new SAXException(e.getMessage());
    }
    resolvedCache.put(systemId, dom.getDocumentURI());
    return dom;
}