javax.xml.bind.helpers.DefaultValidationEventHandler#com.sun.tools.internal.xjc.reader.Const源码实例Demo

下面列出了javax.xml.bind.helpers.DefaultValidationEventHandler#com.sun.tools.internal.xjc.reader.Const 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: TencentKona-8   文件: Internalizer.java
/**
 * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes
 * attribute of the target document.
 */
private void declareExtensionNamespace( Element target, String nsUri ) {
    // look for the attribute
    Element root = target.getOwnerDocument().getDocumentElement();
    Attr att = root.getAttributeNodeNS(Const.JAXB_NSURI,EXTENSION_PREFIXES);
    if( att==null ) {
        String jaxbPrefix = allocatePrefix(root,Const.JAXB_NSURI);
        // no such attribute. Create one.
        att = target.getOwnerDocument().createAttributeNS(
            Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES);
        root.setAttributeNodeNS(att);
    }

    String prefix = allocatePrefix(root,nsUri);
    if( att.getValue().indexOf(prefix)==-1 )
        // avoid redeclaring the same namespace twice.
        att.setValue( att.getValue()+' '+prefix);
}
 
源代码2 项目: TencentKona-8   文件: Internalizer.java
/**
 * Declares a new prefix on the given element and associates it
 * with the specified namespace URI.
 * <p>
 * Note that this method doesn't use the default namespace
 * even if it can.
 */
private String allocatePrefix( Element e, String nsUri ) {
    // look for existing namespaces.
    NamedNodeMap atts = e.getAttributes();
    for( int i=0; i<atts.getLength(); i++ ) {
        Attr a = (Attr)atts.item(i);
        if( Const.XMLNS_URI.equals(a.getNamespaceURI()) ) {
            if( a.getName().indexOf(':')==-1 )  continue;

            if( a.getValue().equals(nsUri) )
                return a.getLocalName();    // found one
        }
    }

    // none found. allocate new.
    while(true) {
        String prefix = "p"+(int)(Math.random()*1000000)+'_';
        if(e.getAttributeNodeNS(Const.XMLNS_URI,prefix)!=null)
            continue;   // this prefix is already allocated.

        e.setAttributeNS(Const.XMLNS_URI,"xmlns:"+prefix,nsUri);
        return prefix;
    }
}
 
源代码3 项目: hottub   文件: Internalizer.java
/**
 * Declares a new prefix on the given element and associates it
 * with the specified namespace URI.
 * <p>
 * Note that this method doesn't use the default namespace
 * even if it can.
 */
private String allocatePrefix( Element e, String nsUri ) {
    // look for existing namespaces.
    NamedNodeMap atts = e.getAttributes();
    for( int i=0; i<atts.getLength(); i++ ) {
        Attr a = (Attr)atts.item(i);
        if( Const.XMLNS_URI.equals(a.getNamespaceURI()) ) {
            if( a.getName().indexOf(':')==-1 )  continue;

            if( a.getValue().equals(nsUri) )
                return a.getLocalName();    // found one
        }
    }

    // none found. allocate new.
    while(true) {
        String prefix = "p"+(int)(Math.random()*1000000)+'_';
        if(e.getAttributeNodeNS(Const.XMLNS_URI,prefix)!=null)
            continue;   // this prefix is already allocated.

        e.setAttributeNS(Const.XMLNS_URI,"xmlns:"+prefix,nsUri);
        return prefix;
    }
}
 
源代码4 项目: TencentKona-8   文件: ModelLoader.java
/**
 * Parses a {@link DOMForest} into a {@link XSSchemaSet}.
 *
 * @return
 *      null if the parsing failed.
 */
public XSSchemaSet createXSOM(DOMForest forest, SCDBasedBindingSet scdBasedBindingSet) throws SAXException {
    // set up other parameters to XSOMParser
    XSOMParser reader = createXSOMParser(forest);

    // re-parse the transformed schemas
    for (String systemId : forest.getRootDocuments()) {
        errorReceiver.pollAbort();
        Document dom = forest.get(systemId);
        if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI)) {
            reader.parse(systemId);
        }
    }

    XSSchemaSet result = reader.getResult();

    if(result!=null)
        scdBasedBindingSet.apply(result,errorReceiver);

    return result;
}
 
源代码5 项目: jdk8u60   文件: Internalizer.java
/**
 * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes
 * attribute of the target document.
 */
private void declareExtensionNamespace( Element target, String nsUri ) {
    // look for the attribute
    Element root = target.getOwnerDocument().getDocumentElement();
    Attr att = root.getAttributeNodeNS(Const.JAXB_NSURI,EXTENSION_PREFIXES);
    if( att==null ) {
        String jaxbPrefix = allocatePrefix(root,Const.JAXB_NSURI);
        // no such attribute. Create one.
        att = target.getOwnerDocument().createAttributeNS(
            Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES);
        root.setAttributeNodeNS(att);
    }

    String prefix = allocatePrefix(root,nsUri);
    if( att.getValue().indexOf(prefix)==-1 )
        // avoid redeclaring the same namespace twice.
        att.setValue( att.getValue()+' '+prefix);
}
 
源代码6 项目: jdk8u60   文件: Internalizer.java
/**
 * Declares a new prefix on the given element and associates it
 * with the specified namespace URI.
 * <p>
 * Note that this method doesn't use the default namespace
 * even if it can.
 */
private String allocatePrefix( Element e, String nsUri ) {
    // look for existing namespaces.
    NamedNodeMap atts = e.getAttributes();
    for( int i=0; i<atts.getLength(); i++ ) {
        Attr a = (Attr)atts.item(i);
        if( Const.XMLNS_URI.equals(a.getNamespaceURI()) ) {
            if( a.getName().indexOf(':')==-1 )  continue;

            if( a.getValue().equals(nsUri) )
                return a.getLocalName();    // found one
        }
    }

    // none found. allocate new.
    while(true) {
        String prefix = "p"+(int)(Math.random()*1000000)+'_';
        if(e.getAttributeNodeNS(Const.XMLNS_URI,prefix)!=null)
            continue;   // this prefix is already allocated.

        e.setAttributeNS(Const.XMLNS_URI,"xmlns:"+prefix,nsUri);
        return prefix;
    }
}
 
源代码7 项目: openjdk-jdk9   文件: Internalizer.java
/**
 * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes
 * attribute of the target document.
 */
private void declareExtensionNamespace( Element target, String nsUri ) {
    // look for the attribute
    Element root = target.getOwnerDocument().getDocumentElement();
    Attr att = root.getAttributeNodeNS(Const.JAXB_NSURI,EXTENSION_PREFIXES);
    if( att==null ) {
        String jaxbPrefix = allocatePrefix(root,Const.JAXB_NSURI);
        // no such attribute. Create one.
        att = target.getOwnerDocument().createAttributeNS(
            Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES);
        root.setAttributeNodeNS(att);
    }

    String prefix = allocatePrefix(root,nsUri);
    if( att.getValue().indexOf(prefix)==-1 )
        // avoid redeclaring the same namespace twice.
        att.setValue( att.getValue()+' '+prefix);
}
 
源代码8 项目: openjdk-jdk8u   文件: Internalizer.java
/**
 * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes
 * attribute of the target document.
 */
private void declareExtensionNamespace( Element target, String nsUri ) {
    // look for the attribute
    Element root = target.getOwnerDocument().getDocumentElement();
    Attr att = root.getAttributeNodeNS(Const.JAXB_NSURI,EXTENSION_PREFIXES);
    if( att==null ) {
        String jaxbPrefix = allocatePrefix(root,Const.JAXB_NSURI);
        // no such attribute. Create one.
        att = target.getOwnerDocument().createAttributeNS(
            Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES);
        root.setAttributeNodeNS(att);
    }

    String prefix = allocatePrefix(root,nsUri);
    if( att.getValue().indexOf(prefix)==-1 )
        // avoid redeclaring the same namespace twice.
        att.setValue( att.getValue()+' '+prefix);
}
 
源代码9 项目: openjdk-jdk8u   文件: Internalizer.java
/**
 * Declares a new prefix on the given element and associates it
 * with the specified namespace URI.
 * <p>
 * Note that this method doesn't use the default namespace
 * even if it can.
 */
private String allocatePrefix( Element e, String nsUri ) {
    // look for existing namespaces.
    NamedNodeMap atts = e.getAttributes();
    for( int i=0; i<atts.getLength(); i++ ) {
        Attr a = (Attr)atts.item(i);
        if( Const.XMLNS_URI.equals(a.getNamespaceURI()) ) {
            if( a.getName().indexOf(':')==-1 )  continue;

            if( a.getValue().equals(nsUri) )
                return a.getLocalName();    // found one
        }
    }

    // none found. allocate new.
    while(true) {
        String prefix = "p"+(int)(Math.random()*1000000)+'_';
        if(e.getAttributeNodeNS(Const.XMLNS_URI,prefix)!=null)
            continue;   // this prefix is already allocated.

        e.setAttributeNS(Const.XMLNS_URI,"xmlns:"+prefix,nsUri);
        return prefix;
    }
}
 
源代码10 项目: openjdk-jdk8u   文件: ModelLoader.java
/**
 * Parses a {@link DOMForest} into a {@link XSSchemaSet}.
 *
 * @return
 *      null if the parsing failed.
 */
public XSSchemaSet createXSOM(DOMForest forest, SCDBasedBindingSet scdBasedBindingSet) throws SAXException {
    // set up other parameters to XSOMParser
    XSOMParser reader = createXSOMParser(forest);

    // re-parse the transformed schemas
    for (String systemId : forest.getRootDocuments()) {
        errorReceiver.pollAbort();
        Document dom = forest.get(systemId);
        if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI)) {
            reader.parse(systemId);
        }
    }

    XSSchemaSet result = reader.getResult();

    if(result!=null)
        scdBasedBindingSet.apply(result,errorReceiver);

    return result;
}
 
源代码11 项目: openjdk-jdk9   文件: Internalizer.java
/**
 * Declares a new prefix on the given element and associates it
 * with the specified namespace URI.
 * <p>
 * Note that this method doesn't use the default namespace
 * even if it can.
 */
private String allocatePrefix( Element e, String nsUri ) {
    // look for existing namespaces.
    NamedNodeMap atts = e.getAttributes();
    for( int i=0; i<atts.getLength(); i++ ) {
        Attr a = (Attr)atts.item(i);
        if( Const.XMLNS_URI.equals(a.getNamespaceURI()) ) {
            if( a.getName().indexOf(':')==-1 )  continue;

            if( a.getValue().equals(nsUri) )
                return a.getLocalName();    // found one
        }
    }

    // none found. allocate new.
    while(true) {
        String prefix = "p"+(int)(Math.random()*1000000)+'_';
        if(e.getAttributeNodeNS(Const.XMLNS_URI,prefix)!=null)
            continue;   // this prefix is already allocated.

        e.setAttributeNS(Const.XMLNS_URI,"xmlns:"+prefix,nsUri);
        return prefix;
    }
}
 
源代码12 项目: openjdk-jdk8u-backup   文件: DOMBuilder.java
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) {
    super.startElement(namespaceURI, localName, qName, atts);

    Element e = getCurrentElement();
    locatorTable.storeStartLocation( e, locator );

    // check if this element is an outer-most <jaxb:bindings>
    if( Const.JAXB_NSURI.equals(e.getNamespaceURI())
    &&  "bindings".equals(e.getLocalName()) ) {

        // if this is the root node (meaning that this file is an
        // external binding file) or if the parent is XML Schema element
        // (meaning that this is an "inlined" external binding)
        Node p = e.getParentNode();
        if( p instanceof Document
        ||( p instanceof Element && !e.getNamespaceURI().equals(p.getNamespaceURI()))) {
            outerMostBindings.add(e);   // remember this value
        }
    }
}
 
源代码13 项目: hottub   文件: Internalizer.java
/**
 * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes
 * attribute of the target document.
 */
private void declareExtensionNamespace( Element target, String nsUri ) {
    // look for the attribute
    Element root = target.getOwnerDocument().getDocumentElement();
    Attr att = root.getAttributeNodeNS(Const.JAXB_NSURI,EXTENSION_PREFIXES);
    if( att==null ) {
        String jaxbPrefix = allocatePrefix(root,Const.JAXB_NSURI);
        // no such attribute. Create one.
        att = target.getOwnerDocument().createAttributeNS(
            Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES);
        root.setAttributeNodeNS(att);
    }

    String prefix = allocatePrefix(root,nsUri);
    if( att.getValue().indexOf(prefix)==-1 )
        // avoid redeclaring the same namespace twice.
        att.setValue( att.getValue()+' '+prefix);
}
 
源代码14 项目: openjdk-jdk8u-backup   文件: Internalizer.java
/**
 * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes
 * attribute of the target document.
 */
private void declareExtensionNamespace( Element target, String nsUri ) {
    // look for the attribute
    Element root = target.getOwnerDocument().getDocumentElement();
    Attr att = root.getAttributeNodeNS(Const.JAXB_NSURI,EXTENSION_PREFIXES);
    if( att==null ) {
        String jaxbPrefix = allocatePrefix(root,Const.JAXB_NSURI);
        // no such attribute. Create one.
        att = target.getOwnerDocument().createAttributeNS(
            Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES);
        root.setAttributeNodeNS(att);
    }

    String prefix = allocatePrefix(root,nsUri);
    if( att.getValue().indexOf(prefix)==-1 )
        // avoid redeclaring the same namespace twice.
        att.setValue( att.getValue()+' '+prefix);
}
 
源代码15 项目: hottub   文件: ModelLoader.java
/**
 * Parses a {@link DOMForest} into a {@link XSSchemaSet}.
 *
 * @return
 *      null if the parsing failed.
 */
public XSSchemaSet createXSOM(DOMForest forest, SCDBasedBindingSet scdBasedBindingSet) throws SAXException {
    // set up other parameters to XSOMParser
    XSOMParser reader = createXSOMParser(forest);

    // re-parse the transformed schemas
    for (String systemId : forest.getRootDocuments()) {
        errorReceiver.pollAbort();
        Document dom = forest.get(systemId);
        if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI)) {
            reader.parse(systemId);
        }
    }

    XSSchemaSet result = reader.getResult();

    if(result!=null)
        scdBasedBindingSet.apply(result,errorReceiver);

    return result;
}
 
源代码16 项目: openjdk-jdk8u-backup   文件: ModelLoader.java
/**
 * Parses a {@link DOMForest} into a {@link XSSchemaSet}.
 *
 * @return
 *      null if the parsing failed.
 */
public XSSchemaSet createXSOM(DOMForest forest, SCDBasedBindingSet scdBasedBindingSet) throws SAXException {
    // set up other parameters to XSOMParser
    XSOMParser reader = createXSOMParser(forest);

    // re-parse the transformed schemas
    for (String systemId : forest.getRootDocuments()) {
        errorReceiver.pollAbort();
        Document dom = forest.get(systemId);
        if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI)) {
            reader.parse(systemId);
        }
    }

    XSSchemaSet result = reader.getResult();

    if(result!=null)
        scdBasedBindingSet.apply(result,errorReceiver);

    return result;
}
 
源代码17 项目: hottub   文件: CustomizationContextChecker.java
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
    QName newElement = new QName(namespaceURI,localName);

    if( newElement.getNamespaceURI().equals(Const.JAXB_NSURI)
     && top().getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA) ) {
        // we hit a JAXB customization. the stack top should be
        // <xs:appinfo>
        if( elementNames.size()>=3 ) {
            // the above statement checks if the following statement doesn't
            // cause an exception.
            QName schemaElement = elementNames.get( elementNames.size()-3 );
            if( prohibitedSchemaElementNames.contains(schemaElement.getLocalPart()) ) {
                // the owner schema element is in the wanted list.
                errorHandler.error( new SAXParseException(
                    Messages.format(
                        Messages.ERR_UNACKNOWLEDGED_CUSTOMIZATION,
                        localName ),
                    locator ) );
            }
        }


    }

    elementNames.push(newElement);

    super.startElement(namespaceURI, localName, qName, atts );
}
 
@Override
public void startPrefixMapping(String prefix, String uri) throws SAXException {
    if (WellKnownNamespace.XML_NAMESPACE_URI.equals(uri)) return; //xml prefix shall not be declared based on jdk api javadoc
    if( prefix.equals("jaxb") )
        isJAXBPrefixUsed = true;
    if( uri.equals(Const.JAXB_NSURI) )
        isCustomizationUsed = true;

    super.startPrefixMapping(prefix, uri);
}
 
@Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
    throws SAXException {
    super.startElement(namespaceURI, localName, qName, atts);

    // I'm not sure if this is necessary (SAX might report the change of the default prefix
    // through the startPrefixMapping method, and I think it does indeed.)
    //
    // but better safe than sorry.

    if( namespaceURI.equals(Const.JAXB_NSURI) )
        isCustomizationUsed = true;
}
 
源代码20 项目: TencentKona-8   文件: UnusedCustomizationChecker.java
private void checkExpectedContentTypes(XSComponent c) {
    if(c.getForeignAttribute(WellKnownNamespace.XML_MIME_URI, Const.EXPECTED_CONTENT_TYPES)==null)
        return; // no such attribute
    if(c instanceof XSParticle)
        return; // particles get the same foreign attributes as local element decls,
                // so we need to skip them

    if(!stb.isAcknowledgedXmimeContentTypes(c)) {
        // this is not used
        getErrorReporter().warning(c.getLocator(),Messages.WARN_UNUSED_EXPECTED_CONTENT_TYPES);
    }
}
 
源代码21 项目: openjdk-8   文件: DTDExtensionBindingChecker.java
/**
 * Returns true if the elements with the given namespace URI
 * should be blocked by this filter.
 */
private boolean needsToBePruned( String uri ) {
    if( uri.equals(schemaLanguage) )
        return false;
    if( uri.equals(Const.JAXB_NSURI) )
        return false;
    if( uri.equals(Const.XJC_EXTENSION_URI) )
        return false;
    // we don't want validator to see extensions that we understand ,
    // because they will complain.
    // OTOH, if  this is an extension that we didn't understand,
    // we want the validator to report an error
    return enabledExtensions.contains(uri);
}
 
protected String findExternalResource( String nsURI, String localName, Attributes atts) {
    if( Const.RELAXNG_URI.equals(nsURI)
    && ("include".equals(localName) || "externalRef".equals(localName) ) )
        return atts.getValue("href");
    else
        return null;
}
 
源代码23 项目: TencentKona-8   文件: DOMForest.java
/**
 * Picks one document at random and returns it.
 */
public Document getOneDocument() {
    for (Document dom : core.values()) {
        if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI))
            return dom;
    }
    // we should have caught this error very early on
    throw new AssertionError();
}
 
源代码24 项目: openjdk-8-source   文件: VersionChecker.java
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
    throws SAXException {

    super.startElement(namespaceURI, localName, qName, atts);

    if(!seenRoot) {
        // if this is the root element
        seenRoot = true;
        rootTagStart = new LocatorImpl(locator);

        version = atts.getValue(Const.JAXB_NSURI,"version");
        if( namespaceURI.equals(Const.JAXB_NSURI) ) {
            String version2 = atts.getValue("","version");
            if( version!=null && version2!=null ) {
                // we have both @version and @jaxb:version. error.
                SAXParseException e = new SAXParseException(
                    Messages.format( Messages.TWO_VERSION_ATTRIBUTES ), locator );
                getErrorHandler().error(e);
            }
            if( version==null )
                version = version2;
        }

    }

    if( Const.JAXB_NSURI.equals(namespaceURI) )
        seenBindings = true;
}
 
源代码25 项目: TencentKona-8   文件: VersionChecker.java
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
    throws SAXException {

    super.startElement(namespaceURI, localName, qName, atts);

    if(!seenRoot) {
        // if this is the root element
        seenRoot = true;
        rootTagStart = new LocatorImpl(locator);

        version = atts.getValue(Const.JAXB_NSURI,"version");
        if( namespaceURI.equals(Const.JAXB_NSURI) ) {
            String version2 = atts.getValue("","version");
            if( version!=null && version2!=null ) {
                // we have both @version and @jaxb:version. error.
                SAXParseException e = new SAXParseException(
                    Messages.format( Messages.TWO_VERSION_ATTRIBUTES ), locator );
                getErrorHandler().error(e);
            }
            if( version==null )
                version = version2;
        }

    }

    if( Const.JAXB_NSURI.equals(namespaceURI) )
        seenBindings = true;
}
 
protected String findExternalResource( String nsURI, String localName, Attributes atts) {
    if( Const.RELAXNG_URI.equals(nsURI)
    && ("include".equals(localName) || "externalRef".equals(localName) ) )
        return atts.getValue("href");
    else
        return null;
}
 
源代码27 项目: hottub   文件: Internalizer.java
/**
 * Recursively visits sub-elements and declare all used namespaces.
 * TODO: the fact that we recognize all namespaces in the extension
 * is a bad design.
 */
private void declExtensionNamespace(Element decl, Element target) {
    // if this comes from external namespaces, add the namespace to
    // @extensionBindingPrefixes.
    if( !Const.JAXB_NSURI.equals(decl.getNamespaceURI()) )
        declareExtensionNamespace( target, decl.getNamespaceURI() );

    NodeList lst = decl.getChildNodes();
    for( int i=0; i<lst.getLength(); i++ ) {
        Node n = lst.item(i);
        if( n instanceof Element )
            declExtensionNamespace( (Element)n, target );
    }
}
 
源代码28 项目: TencentKona-8   文件: ModelLoader.java
/**
 * Parses a RELAX NG grammar into an annotated grammar.
 */
private Model loadRELAXNG() throws SAXException {

    // build DOM forest
    final DOMForest forest = buildDOMForest( new RELAXNGInternalizationLogic() );

    // use JAXP masquerading to validate the input document.
    // DOMForest -> ExtensionBindingChecker -> RNGOM

    XMLReaderCreator xrc = new XMLReaderCreator() {
        public XMLReader createXMLReader() {

            // foreset parser cannot change the receivers while it's working,
            // so we need to have one XMLFilter that works as a buffer
            XMLFilter buffer = new XMLFilterImpl() {
                @Override
                public void parse(InputSource source) throws IOException, SAXException {
                    forest.createParser().parse( source, this, this, this );
                }
            };

            XMLFilter f = new ExtensionBindingChecker(Const.RELAXNG_URI,opt,errorReceiver);
            f.setParent(buffer);

            f.setEntityResolver(opt.entityResolver);

            return f;
        }
    };

    Parseable p = new SAXParseable( opt.getGrammars()[0], errorReceiver, xrc );

    return loadRELAXNG(p);

}
 
源代码29 项目: openjdk-jdk9   文件: DTDExtensionBindingChecker.java
/**
 * Returns true if the elements with the given namespace URI
 * should be blocked by this filter.
 */
private boolean needsToBePruned( String uri ) {
    if( uri.equals(schemaLanguage) )
        return false;
    if( uri.equals(Const.JAXB_NSURI) )
        return false;
    if( uri.equals(Const.XJC_EXTENSION_URI) )
        return false;
    // we don't want validator to see extensions that we understand ,
    // because they will complain.
    // OTOH, if  this is an extension that we didn't understand,
    // we want the validator to report an error
    return enabledExtensions.contains(uri);
}
 
源代码30 项目: hottub   文件: IncorrectNamespaceURIChecker.java
@Override
public void endDocument() throws SAXException {
    if( isJAXBPrefixUsed && !isCustomizationUsed ) {
        SAXParseException e = new SAXParseException(
            Messages.format(Messages.WARN_INCORRECT_URI, Const.JAXB_NSURI),
            locator );
        errorHandler.warning(e);
    }

    super.endDocument();
}