com.sun.tools.internal.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic Java Examples

The following examples show how to use com.sun.tools.internal.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic. 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: ModelLoader.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses a set of XML Schema files into an annotated grammar.
 */
public XSSchemaSet loadXMLSchema() throws SAXException {

    if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver, opt.disableXmlSecurity)) {
        // schema error. error should have been reported
        return null;
    }

    if(opt.getBindFiles().length==0) {
        // no external binding. try the speculative no DOMForest execution,
        // which is faster if the speculation succeeds.
        try {
            return createXSOMSpeculative();
        } catch( SpeculationFailure e) {
            // failed. go the slow way
        }
    }

    // the default slower way is to parse everything into DOM first.
    // so that we can take external annotations into account.
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
    return createXSOM(forest, scdBasedBindingSet);
}
 
Example #2
Source File: ModelLoader.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses a set of XML Schema files into an annotated grammar.
 */
public XSSchemaSet loadXMLSchema() throws SAXException {

    if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver, opt.disableXmlSecurity)) {
        // schema error. error should have been reported
        return null;
    }

    if(opt.getBindFiles().length==0) {
        // no external binding. try the speculative no DOMForest execution,
        // which is faster if the speculation succeeds.
        try {
            return createXSOMSpeculative();
        } catch( SpeculationFailure e) {
            // failed. go the slow way
        }
    }

    // the default slower way is to parse everything into DOM first.
    // so that we can take external annotations into account.
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
    return createXSOM(forest, scdBasedBindingSet);
}
 
Example #3
Source File: ModelLoader.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses a set of XML Schema files into an annotated grammar.
 */
public XSSchemaSet loadXMLSchema() throws SAXException {

    if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver, opt.disableXmlSecurity)) {
        // schema error. error should have been reported
        return null;
    }

    if(opt.getBindFiles().length==0) {
        // no external binding. try the speculative no DOMForest execution,
        // which is faster if the speculation succeeds.
        try {
            return createXSOMSpeculative();
        } catch( SpeculationFailure e) {
            // failed. go the slow way
        }
    }

    // the default slower way is to parse everything into DOM first.
    // so that we can take external annotations into account.
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
    return createXSOM(forest, scdBasedBindingSet);
}
 
Example #4
Source File: ModelLoader.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses a set of XML Schema files into an annotated grammar.
 */
public XSSchemaSet loadXMLSchema() throws SAXException {

    if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver, opt.disableXmlSecurity)) {
        // schema error. error should have been reported
        return null;
    }

    if(opt.getBindFiles().length==0) {
        // no external binding. try the speculative no DOMForest execution,
        // which is faster if the speculation succeeds.
        try {
            return createXSOMSpeculative();
        } catch( SpeculationFailure e) {
            // failed. go the slow way
        }
    }

    // the default slower way is to parse everything into DOM first.
    // so that we can take external annotations into account.
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
    return createXSOM(forest, scdBasedBindingSet);
}
 
Example #5
Source File: ModelLoader.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses a set of XML Schema files into an annotated grammar.
 */
public XSSchemaSet loadXMLSchema() throws SAXException {

    if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver, opt.disableXmlSecurity)) {
        // schema error. error should have been reported
        return null;
    }

    if(opt.getBindFiles().length==0) {
        // no external binding. try the speculative no DOMForest execution,
        // which is faster if the speculation succeeds.
        try {
            return createXSOMSpeculative();
        } catch( SpeculationFailure e) {
            // failed. go the slow way
        }
    }

    // the default slower way is to parse everything into DOM first.
    // so that we can take external annotations into account.
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
    return createXSOM(forest, scdBasedBindingSet);
}
 
Example #6
Source File: ModelLoader.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses a set of XML Schema files into an annotated grammar.
 */
public XSSchemaSet loadXMLSchema() throws SAXException {

    if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver, opt.disableXmlSecurity)) {
        // schema error. error should have been reported
        return null;
    }

    if(opt.getBindFiles().length==0) {
        // no external binding. try the speculative no DOMForest execution,
        // which is faster if the speculation succeeds.
        try {
            return createXSOMSpeculative();
        } catch( SpeculationFailure e) {
            // failed. go the slow way
        }
    }

    // the default slower way is to parse everything into DOM first.
    // so that we can take external annotations into account.
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
    return createXSOM(forest, scdBasedBindingSet);
}
 
Example #7
Source File: ModelLoader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses a set of XML Schema files into an annotated grammar.
 */
public XSSchemaSet loadXMLSchema() throws SAXException {

    if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver, opt.disableXmlSecurity)) {
        // schema error. error should have been reported
        return null;
    }

    if(opt.getBindFiles().length==0) {
        // no external binding. try the speculative no DOMForest execution,
        // which is faster if the speculation succeeds.
        try {
            return createXSOMSpeculative();
        } catch( SpeculationFailure e) {
            // failed. go the slow way
        }
    }

    // the default slower way is to parse everything into DOM first.
    // so that we can take external annotations into account.
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
    return createXSOM(forest, scdBasedBindingSet);
}
 
Example #8
Source File: ModelLoader.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses a set of XML Schema files into an annotated grammar.
 */
public XSSchemaSet loadXMLSchema() throws SAXException {

    if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver, opt.disableXmlSecurity)) {
        // schema error. error should have been reported
        return null;
    }

    if(opt.getBindFiles().length==0) {
        // no external binding. try the speculative no DOMForest execution,
        // which is faster if the speculation succeeds.
        try {
            return createXSOMSpeculative();
        } catch( SpeculationFailure e) {
            // failed. go the slow way
        }
    }

    // the default slower way is to parse everything into DOM first.
    // so that we can take external annotations into account.
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
    return createXSOM(forest, scdBasedBindingSet);
}
 
Example #9
Source File: ModelLoader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses a set of schemas inside a WSDL file.
 *
 * A WSDL file may contain multiple <xsd:schema> elements.
 */
private XSSchemaSet loadWSDL()
    throws SAXException {


    // build DOMForest just like we handle XML Schema
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );

    DOMForestScanner scanner = new DOMForestScanner(forest);

    XSOMParser xsomParser = createXSOMParser( forest );

    // find <xsd:schema>s and parse them individually
    for( InputSource grammar : opt.getGrammars() ) {
        Document wsdlDom = forest.get( grammar.getSystemId() );
        if (wsdlDom == null) {
            String systemId = Options.normalizeSystemId(grammar.getSystemId());
            if (forest.get(systemId) != null) {
                grammar.setSystemId(systemId);
                wsdlDom = forest.get( grammar.getSystemId() );
            }
        }

        NodeList schemas = wsdlDom.getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI,"schema");
        for( int i=0; i<schemas.getLength(); i++ )
            scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() );
    }
    return xsomParser.getResult();
}
 
Example #10
Source File: ModelLoader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses a set of schemas inside a WSDL file.
 *
 * A WSDL file may contain multiple &lt;xsd:schema> elements.
 */
private XSSchemaSet loadWSDL()
    throws SAXException {


    // build DOMForest just like we handle XML Schema
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );

    DOMForestScanner scanner = new DOMForestScanner(forest);

    XSOMParser xsomParser = createXSOMParser( forest );

    // find <xsd:schema>s and parse them individually
    for( InputSource grammar : opt.getGrammars() ) {
        Document wsdlDom = forest.get( grammar.getSystemId() );
        if (wsdlDom == null) {
            String systemId = Options.normalizeSystemId(grammar.getSystemId());
            if (forest.get(systemId) != null) {
                grammar.setSystemId(systemId);
                wsdlDom = forest.get( grammar.getSystemId() );
            }
        }

        NodeList schemas = wsdlDom.getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI,"schema");
        for( int i=0; i<schemas.getLength(); i++ )
            scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() );
    }
    return xsomParser.getResult();
}
 
Example #11
Source File: ModelLoader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses a set of schemas inside a WSDL file.
 *
 * A WSDL file may contain multiple &lt;xsd:schema> elements.
 */
private XSSchemaSet loadWSDL()
    throws SAXException {


    // build DOMForest just like we handle XML Schema
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );

    DOMForestScanner scanner = new DOMForestScanner(forest);

    XSOMParser xsomParser = createXSOMParser( forest );

    // find <xsd:schema>s and parse them individually
    for( InputSource grammar : opt.getGrammars() ) {
        Document wsdlDom = forest.get( grammar.getSystemId() );
        if (wsdlDom == null) {
            String systemId = Options.normalizeSystemId(grammar.getSystemId());
            if (forest.get(systemId) != null) {
                grammar.setSystemId(systemId);
                wsdlDom = forest.get( grammar.getSystemId() );
            }
        }

        NodeList schemas = wsdlDom.getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI,"schema");
        for( int i=0; i<schemas.getLength(); i++ )
            scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() );
    }
    return xsomParser.getResult();
}
 
Example #12
Source File: ModelLoader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses a set of schemas inside a WSDL file.
 *
 * A WSDL file may contain multiple {@code <xsd:schema>} elements.
 */
private XSSchemaSet loadWSDL()
    throws SAXException {


    // build DOMForest just like we handle XML Schema
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );

    DOMForestScanner scanner = new DOMForestScanner(forest);

    XSOMParser xsomParser = createXSOMParser( forest );

    // find <xsd:schema>s and parse them individually
    for( InputSource grammar : opt.getGrammars() ) {
        Document wsdlDom = forest.get( grammar.getSystemId() );
        if (wsdlDom == null) {
            String systemId = Options.normalizeSystemId(grammar.getSystemId());
            if (forest.get(systemId) != null) {
                grammar.setSystemId(systemId);
                wsdlDom = forest.get( grammar.getSystemId() );
            }
        }

        NodeList schemas = wsdlDom.getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI,"schema");
        for( int i=0; i<schemas.getLength(); i++ )
            scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() );
    }
    return xsomParser.getResult();
}
 
Example #13
Source File: ModelLoader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses a set of schemas inside a WSDL file.
 *
 * A WSDL file may contain multiple &lt;xsd:schema> elements.
 */
private XSSchemaSet loadWSDL()
    throws SAXException {


    // build DOMForest just like we handle XML Schema
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );

    DOMForestScanner scanner = new DOMForestScanner(forest);

    XSOMParser xsomParser = createXSOMParser( forest );

    // find <xsd:schema>s and parse them individually
    for( InputSource grammar : opt.getGrammars() ) {
        Document wsdlDom = forest.get( grammar.getSystemId() );
        if (wsdlDom == null) {
            String systemId = Options.normalizeSystemId(grammar.getSystemId());
            if (forest.get(systemId) != null) {
                grammar.setSystemId(systemId);
                wsdlDom = forest.get( grammar.getSystemId() );
            }
        }

        NodeList schemas = wsdlDom.getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI,"schema");
        for( int i=0; i<schemas.getLength(); i++ )
            scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() );
    }
    return xsomParser.getResult();
}
 
Example #14
Source File: ModelLoader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses a set of schemas inside a WSDL file.
 *
 * A WSDL file may contain multiple &lt;xsd:schema> elements.
 */
private XSSchemaSet loadWSDL()
    throws SAXException {


    // build DOMForest just like we handle XML Schema
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );

    DOMForestScanner scanner = new DOMForestScanner(forest);

    XSOMParser xsomParser = createXSOMParser( forest );

    // find <xsd:schema>s and parse them individually
    for( InputSource grammar : opt.getGrammars() ) {
        Document wsdlDom = forest.get( grammar.getSystemId() );
        if (wsdlDom == null) {
            String systemId = Options.normalizeSystemId(grammar.getSystemId());
            if (forest.get(systemId) != null) {
                grammar.setSystemId(systemId);
                wsdlDom = forest.get( grammar.getSystemId() );
            }
        }

        NodeList schemas = wsdlDom.getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI,"schema");
        for( int i=0; i<schemas.getLength(); i++ )
            scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() );
    }
    return xsomParser.getResult();
}
 
Example #15
Source File: ModelLoader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses a set of schemas inside a WSDL file.
 *
 * A WSDL file may contain multiple &lt;xsd:schema> elements.
 */
private XSSchemaSet loadWSDL()
    throws SAXException {


    // build DOMForest just like we handle XML Schema
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );

    DOMForestScanner scanner = new DOMForestScanner(forest);

    XSOMParser xsomParser = createXSOMParser( forest );

    // find <xsd:schema>s and parse them individually
    for( InputSource grammar : opt.getGrammars() ) {
        Document wsdlDom = forest.get( grammar.getSystemId() );
        if (wsdlDom == null) {
            String systemId = Options.normalizeSystemId(grammar.getSystemId());
            if (forest.get(systemId) != null) {
                grammar.setSystemId(systemId);
                wsdlDom = forest.get( grammar.getSystemId() );
            }
        }

        NodeList schemas = wsdlDom.getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI,"schema");
        for( int i=0; i<schemas.getLength(); i++ )
            scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() );
    }
    return xsomParser.getResult();
}
 
Example #16
Source File: ModelLoader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses a set of schemas inside a WSDL file.
 *
 * A WSDL file may contain multiple &lt;xsd:schema> elements.
 */
private XSSchemaSet loadWSDL()
    throws SAXException {


    // build DOMForest just like we handle XML Schema
    DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );

    DOMForestScanner scanner = new DOMForestScanner(forest);

    XSOMParser xsomParser = createXSOMParser( forest );

    // find <xsd:schema>s and parse them individually
    for( InputSource grammar : opt.getGrammars() ) {
        Document wsdlDom = forest.get( grammar.getSystemId() );
        if (wsdlDom == null) {
            String systemId = Options.normalizeSystemId(grammar.getSystemId());
            if (forest.get(systemId) != null) {
                grammar.setSystemId(systemId);
                wsdlDom = forest.get( grammar.getSystemId() );
            }
        }

        NodeList schemas = wsdlDom.getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI,"schema");
        for( int i=0; i<schemas.getLength(); i++ )
            scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() );
    }
    return xsomParser.getResult();
}
 
Example #17
Source File: SchemaCompilerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void resetSchema() {
    forest = new DOMForest(new XMLSchemaInternalizationLogic(), opts);
    forest.setErrorHandler(this);
    forest.setEntityResolver(opts.entityResolver);
}
 
Example #18
Source File: SchemaCompilerImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void resetSchema() {
    forest = new DOMForest(new XMLSchemaInternalizationLogic(), opts);
    forest.setErrorHandler(this);
    forest.setEntityResolver(opts.entityResolver);
}
 
Example #19
Source File: SchemaCompilerImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void resetSchema() {
    forest = new DOMForest(new XMLSchemaInternalizationLogic(), opts);
    forest.setErrorHandler(this);
    forest.setEntityResolver(opts.entityResolver);
}
 
Example #20
Source File: SchemaCompilerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void resetSchema() {
    forest = new DOMForest(new XMLSchemaInternalizationLogic(), opts);
    forest.setErrorHandler(this);
    forest.setEntityResolver(opts.entityResolver);
}
 
Example #21
Source File: SchemaCompilerImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void resetSchema() {
    forest = new DOMForest(new XMLSchemaInternalizationLogic(), opts);
    forest.setErrorHandler(this);
    forest.setEntityResolver(opts.entityResolver);
}
 
Example #22
Source File: SchemaCompilerImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void resetSchema() {
    forest = new DOMForest(new XMLSchemaInternalizationLogic(), opts);
    forest.setErrorHandler(this);
    forest.setEntityResolver(opts.entityResolver);
}
 
Example #23
Source File: SchemaCompilerImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void resetSchema() {
    forest = new DOMForest(new XMLSchemaInternalizationLogic(), opts);
    forest.setErrorHandler(this);
    forest.setEntityResolver(opts.entityResolver);
}
 
Example #24
Source File: SchemaCompilerImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void resetSchema() {
    forest = new DOMForest(new XMLSchemaInternalizationLogic(), opts);
    forest.setErrorHandler(this);
    forest.setEntityResolver(opts.entityResolver);
}