Java Code Examples for com.sun.org.apache.xerces.internal.util.DOMUtil#setHidden()

The following examples show how to use com.sun.org.apache.xerces.internal.util.DOMUtil#setHidden() . 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: XSDHandler.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
protected void resolveKeyRefs() {
    for (int i=0; i<fKeyrefStackPos; i++) {
        XSDocumentInfo keyrefSchemaDoc = fKeyrefsMapXSDocumentInfo[i];
        keyrefSchemaDoc.fNamespaceSupport.makeGlobal();
        keyrefSchemaDoc.fNamespaceSupport.setEffectiveContext( fKeyrefNamespaceContext[i] );
        SchemaGrammar keyrefGrammar = fGrammarBucket.getGrammar(keyrefSchemaDoc.fTargetNamespace);
        // need to set <keyref> to hidden before traversing it,
        // because it has global scope
            DOMUtil.setHidden(fKeyrefs[i], fHiddenNodes);
        fKeyrefTraverser.traverse(fKeyrefs[i], fKeyrefElems[i], keyrefSchemaDoc, keyrefGrammar);
    }
}
 
Example 2
Source File: XSDHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected void resolveKeyRefs() {
    for (int i=0; i<fKeyrefStackPos; i++) {
        XSDocumentInfo keyrefSchemaDoc = fKeyrefsMapXSDocumentInfo[i];
        keyrefSchemaDoc.fNamespaceSupport.makeGlobal();
        keyrefSchemaDoc.fNamespaceSupport.setEffectiveContext( fKeyrefNamespaceContext[i] );
        SchemaGrammar keyrefGrammar = fGrammarBucket.getGrammar(keyrefSchemaDoc.fTargetNamespace);
        // need to set <keyref> to hidden before traversing it,
        // because it has global scope
            DOMUtil.setHidden(fKeyrefs[i], fHiddenNodes);
        fKeyrefTraverser.traverse(fKeyrefs[i], fKeyrefElems[i], keyrefSchemaDoc, keyrefGrammar);
    }
}
 
Example 3
Source File: XSDHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected void resolveKeyRefs() {
    for (int i=0; i<fKeyrefStackPos; i++) {
        XSDocumentInfo keyrefSchemaDoc = fKeyrefsMapXSDocumentInfo[i];
        keyrefSchemaDoc.fNamespaceSupport.makeGlobal();
        keyrefSchemaDoc.fNamespaceSupport.setEffectiveContext( fKeyrefNamespaceContext[i] );
        SchemaGrammar keyrefGrammar = fGrammarBucket.getGrammar(keyrefSchemaDoc.fTargetNamespace);
        // need to set <keyref> to hidden before traversing it,
        // because it has global scope
            DOMUtil.setHidden(fKeyrefs[i], fHiddenNodes);
        fKeyrefTraverser.traverse(fKeyrefs[i], fKeyrefElems[i], keyrefSchemaDoc, keyrefGrammar);
    }
}
 
Example 4
Source File: XSDHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected void resolveKeyRefs() {
    for (int i=0; i<fKeyrefStackPos; i++) {
        XSDocumentInfo keyrefSchemaDoc = fKeyrefsMapXSDocumentInfo[i];
        keyrefSchemaDoc.fNamespaceSupport.makeGlobal();
        keyrefSchemaDoc.fNamespaceSupport.setEffectiveContext( fKeyrefNamespaceContext[i] );
        SchemaGrammar keyrefGrammar = fGrammarBucket.getGrammar(keyrefSchemaDoc.fTargetNamespace);
        // need to set <keyref> to hidden before traversing it,
        // because it has global scope
            DOMUtil.setHidden(fKeyrefs[i], fHiddenNodes);
        fKeyrefTraverser.traverse(fKeyrefs[i], fKeyrefElems[i], keyrefSchemaDoc, keyrefGrammar);
    }
}
 
Example 5
Source File: XSDHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected void resolveKeyRefs() {
    for (int i=0; i<fKeyrefStackPos; i++) {
        XSDocumentInfo keyrefSchemaDoc = fKeyrefsMapXSDocumentInfo[i];
        keyrefSchemaDoc.fNamespaceSupport.makeGlobal();
        keyrefSchemaDoc.fNamespaceSupport.setEffectiveContext( fKeyrefNamespaceContext[i] );
        SchemaGrammar keyrefGrammar = fGrammarBucket.getGrammar(keyrefSchemaDoc.fTargetNamespace);
        // need to set <keyref> to hidden before traversing it,
        // because it has global scope
            DOMUtil.setHidden(fKeyrefs[i], fHiddenNodes);
        fKeyrefTraverser.traverse(fKeyrefs[i], fKeyrefElems[i], keyrefSchemaDoc, keyrefGrammar);
    }
}
 
Example 6
Source File: XSDHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void resolveKeyRefs() {
    for (int i=0; i<fKeyrefStackPos; i++) {
        XSDocumentInfo keyrefSchemaDoc = fKeyrefsMapXSDocumentInfo[i];
        keyrefSchemaDoc.fNamespaceSupport.makeGlobal();
        keyrefSchemaDoc.fNamespaceSupport.setEffectiveContext( fKeyrefNamespaceContext[i] );
        SchemaGrammar keyrefGrammar = fGrammarBucket.getGrammar(keyrefSchemaDoc.fTargetNamespace);
        // need to set <keyref> to hidden before traversing it,
        // because it has global scope
            DOMUtil.setHidden(fKeyrefs[i], fHiddenNodes);
        fKeyrefTraverser.traverse(fKeyrefs[i], fKeyrefElems[i], keyrefSchemaDoc, keyrefGrammar);
    }
}
 
Example 7
Source File: XSDHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void resolveKeyRefs() {
    for (int i=0; i<fKeyrefStackPos; i++) {
        XSDocumentInfo keyrefSchemaDoc = fKeyrefsMapXSDocumentInfo[i];
        keyrefSchemaDoc.fNamespaceSupport.makeGlobal();
        keyrefSchemaDoc.fNamespaceSupport.setEffectiveContext( fKeyrefNamespaceContext[i] );
        SchemaGrammar keyrefGrammar = fGrammarBucket.getGrammar(keyrefSchemaDoc.fTargetNamespace);
        // need to set <keyref> to hidden before traversing it,
        // because it has global scope
            DOMUtil.setHidden(fKeyrefs[i], fHiddenNodes);
        fKeyrefTraverser.traverse(fKeyrefs[i], fKeyrefElems[i], keyrefSchemaDoc, keyrefGrammar);
    }
}
 
Example 8
Source File: XSDHandler.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
protected void resolveKeyRefs() {
    for (int i=0; i<fKeyrefStackPos; i++) {
        XSDocumentInfo keyrefSchemaDoc = fKeyrefsMapXSDocumentInfo[i];
        keyrefSchemaDoc.fNamespaceSupport.makeGlobal();
        keyrefSchemaDoc.fNamespaceSupport.setEffectiveContext( fKeyrefNamespaceContext[i] );
        SchemaGrammar keyrefGrammar = fGrammarBucket.getGrammar(keyrefSchemaDoc.fTargetNamespace);
        // need to set <keyref> to hidden before traversing it,
        // because it has global scope
            DOMUtil.setHidden(fKeyrefs[i], fHiddenNodes);
        fKeyrefTraverser.traverse(fKeyrefs[i], fKeyrefElems[i], keyrefSchemaDoc, keyrefGrammar);
    }
}
 
Example 9
Source File: XSDHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected void resolveKeyRefs() {
    for (int i=0; i<fKeyrefStackPos; i++) {
        XSDocumentInfo keyrefSchemaDoc = fKeyrefsMapXSDocumentInfo[i];
        keyrefSchemaDoc.fNamespaceSupport.makeGlobal();
        keyrefSchemaDoc.fNamespaceSupport.setEffectiveContext( fKeyrefNamespaceContext[i] );
        SchemaGrammar keyrefGrammar = fGrammarBucket.getGrammar(keyrefSchemaDoc.fTargetNamespace);
        // need to set <keyref> to hidden before traversing it,
        // because it has global scope
            DOMUtil.setHidden(fKeyrefs[i], fHiddenNodes);
        fKeyrefTraverser.traverse(fKeyrefs[i], fKeyrefElems[i], keyrefSchemaDoc, keyrefGrammar);
    }
}
 
Example 10
Source File: XSDHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected void resolveKeyRefs() {
    for (int i=0; i<fKeyrefStackPos; i++) {
        XSDocumentInfo keyrefSchemaDoc = fKeyrefsMapXSDocumentInfo[i];
        keyrefSchemaDoc.fNamespaceSupport.makeGlobal();
        keyrefSchemaDoc.fNamespaceSupport.setEffectiveContext( fKeyrefNamespaceContext[i] );
        SchemaGrammar keyrefGrammar = fGrammarBucket.getGrammar(keyrefSchemaDoc.fTargetNamespace);
        // need to set <keyref> to hidden before traversing it,
        // because it has global scope
            DOMUtil.setHidden(fKeyrefs[i], fHiddenNodes);
        fKeyrefTraverser.traverse(fKeyrefs[i], fKeyrefElems[i], keyrefSchemaDoc, keyrefGrammar);
    }
}
 
Example 11
Source File: XSDHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
    Object retObj = null;

    DOMUtil.setHidden(decl, fHiddenNodes);
    SchemaNamespaceSupport nsSupport = null;
    // if the parent is <redefine> use the namespace delcs for it.
    Element parent = DOMUtil.getParent(decl);
    if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
        nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
    // back up the current SchemaNamespaceSupport, because we need to provide
    // a fresh one to the traverseGlobal methods.
    schemaDoc.backupNSSupport(nsSupport);

    // traverse the referenced global component
    switch (declType) {
    case TYPEDECL_TYPE :
        if (DOMUtil.getLocalName(decl).equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
            retObj = fComplexTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        else {
            retObj = fSimpleTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        break;
    case ATTRIBUTE_TYPE :
        retObj = fAttributeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ELEMENT_TYPE :
        retObj = fElementTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ATTRIBUTEGROUP_TYPE :
        retObj = fAttributeGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case GROUP_TYPE :
        retObj = fGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case NOTATION_TYPE :
        retObj = fNotationTraverser.traverse(decl, schemaDoc, grammar);
        break;
    case IDENTITYCONSTRAINT_TYPE :
        // identity constraints should have been parsed already...
        // we should never get here
        break;
    }

    // restore the previous SchemaNamespaceSupport, so that the caller can get
    // proper namespace binding.
    schemaDoc.restoreNSSupport();

    return retObj;
}
 
Example 12
Source File: XSDHandler.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
    Object retObj = null;

    DOMUtil.setHidden(decl, fHiddenNodes);
    SchemaNamespaceSupport nsSupport = null;
    // if the parent is <redefine> use the namespace delcs for it.
    Element parent = DOMUtil.getParent(decl);
    if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
        nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
    // back up the current SchemaNamespaceSupport, because we need to provide
    // a fresh one to the traverseGlobal methods.
    schemaDoc.backupNSSupport(nsSupport);

    // traverse the referenced global component
    switch (declType) {
    case TYPEDECL_TYPE :
        if (DOMUtil.getLocalName(decl).equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
            retObj = fComplexTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        else {
            retObj = fSimpleTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        break;
    case ATTRIBUTE_TYPE :
        retObj = fAttributeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ELEMENT_TYPE :
        retObj = fElementTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ATTRIBUTEGROUP_TYPE :
        retObj = fAttributeGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case GROUP_TYPE :
        retObj = fGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case NOTATION_TYPE :
        retObj = fNotationTraverser.traverse(decl, schemaDoc, grammar);
        break;
    case IDENTITYCONSTRAINT_TYPE :
        // identity constraints should have been parsed already...
        // we should never get here
        break;
    }

    // restore the previous SchemaNamespaceSupport, so that the caller can get
    // proper namespace binding.
    schemaDoc.restoreNSSupport();

    return retObj;
}
 
Example 13
Source File: XSDHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
    Object retObj = null;

    DOMUtil.setHidden(decl, fHiddenNodes);
    SchemaNamespaceSupport nsSupport = null;
    // if the parent is <redefine> use the namespace delcs for it.
    Element parent = DOMUtil.getParent(decl);
    if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
        nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
    // back up the current SchemaNamespaceSupport, because we need to provide
    // a fresh one to the traverseGlobal methods.
    schemaDoc.backupNSSupport(nsSupport);

    // traverse the referenced global component
    switch (declType) {
    case TYPEDECL_TYPE :
        if (DOMUtil.getLocalName(decl).equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
            retObj = fComplexTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        else {
            retObj = fSimpleTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        break;
    case ATTRIBUTE_TYPE :
        retObj = fAttributeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ELEMENT_TYPE :
        retObj = fElementTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ATTRIBUTEGROUP_TYPE :
        retObj = fAttributeGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case GROUP_TYPE :
        retObj = fGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case NOTATION_TYPE :
        retObj = fNotationTraverser.traverse(decl, schemaDoc, grammar);
        break;
    case IDENTITYCONSTRAINT_TYPE :
        // identity constraints should have been parsed already...
        // we should never get here
        break;
    }

    // restore the previous SchemaNamespaceSupport, so that the caller can get
    // proper namespace binding.
    schemaDoc.restoreNSSupport();

    return retObj;
}
 
Example 14
Source File: XSDHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
    Object retObj = null;

    DOMUtil.setHidden(decl, fHiddenNodes);
    SchemaNamespaceSupport nsSupport = null;
    // if the parent is <redefine> use the namespace delcs for it.
    Element parent = DOMUtil.getParent(decl);
    if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
        nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
    // back up the current SchemaNamespaceSupport, because we need to provide
    // a fresh one to the traverseGlobal methods.
    schemaDoc.backupNSSupport(nsSupport);

    // traverse the referenced global component
    switch (declType) {
    case TYPEDECL_TYPE :
        if (DOMUtil.getLocalName(decl).equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
            retObj = fComplexTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        else {
            retObj = fSimpleTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        break;
    case ATTRIBUTE_TYPE :
        retObj = fAttributeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ELEMENT_TYPE :
        retObj = fElementTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ATTRIBUTEGROUP_TYPE :
        retObj = fAttributeGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case GROUP_TYPE :
        retObj = fGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case NOTATION_TYPE :
        retObj = fNotationTraverser.traverse(decl, schemaDoc, grammar);
        break;
    case IDENTITYCONSTRAINT_TYPE :
        // identity constraints should have been parsed already...
        // we should never get here
        break;
    }

    // restore the previous SchemaNamespaceSupport, so that the caller can get
    // proper namespace binding.
    schemaDoc.restoreNSSupport();

    return retObj;
}
 
Example 15
Source File: XSDHandler.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
    Object retObj = null;

    DOMUtil.setHidden(decl, fHiddenNodes);
    SchemaNamespaceSupport nsSupport = null;
    // if the parent is <redefine> use the namespace delcs for it.
    Element parent = DOMUtil.getParent(decl);
    if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
        nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
    // back up the current SchemaNamespaceSupport, because we need to provide
    // a fresh one to the traverseGlobal methods.
    schemaDoc.backupNSSupport(nsSupport);

    // traverse the referenced global component
    switch (declType) {
    case TYPEDECL_TYPE :
        if (DOMUtil.getLocalName(decl).equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
            retObj = fComplexTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        else {
            retObj = fSimpleTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        break;
    case ATTRIBUTE_TYPE :
        retObj = fAttributeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ELEMENT_TYPE :
        retObj = fElementTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ATTRIBUTEGROUP_TYPE :
        retObj = fAttributeGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case GROUP_TYPE :
        retObj = fGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case NOTATION_TYPE :
        retObj = fNotationTraverser.traverse(decl, schemaDoc, grammar);
        break;
    case IDENTITYCONSTRAINT_TYPE :
        // identity constraints should have been parsed already...
        // we should never get here
        break;
    }

    // restore the previous SchemaNamespaceSupport, so that the caller can get
    // proper namespace binding.
    schemaDoc.restoreNSSupport();

    return retObj;
}
 
Example 16
Source File: XSDHandler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
    Object retObj = null;

    DOMUtil.setHidden(decl, fHiddenNodes);
    SchemaNamespaceSupport nsSupport = null;
    // if the parent is <redefine> use the namespace delcs for it.
    Element parent = DOMUtil.getParent(decl);
    if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
        nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
    // back up the current SchemaNamespaceSupport, because we need to provide
    // a fresh one to the traverseGlobal methods.
    schemaDoc.backupNSSupport(nsSupport);

    // traverse the referenced global component
    switch (declType) {
    case TYPEDECL_TYPE :
        if (DOMUtil.getLocalName(decl).equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
            retObj = fComplexTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        else {
            retObj = fSimpleTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        break;
    case ATTRIBUTE_TYPE :
        retObj = fAttributeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ELEMENT_TYPE :
        retObj = fElementTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ATTRIBUTEGROUP_TYPE :
        retObj = fAttributeGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case GROUP_TYPE :
        retObj = fGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case NOTATION_TYPE :
        retObj = fNotationTraverser.traverse(decl, schemaDoc, grammar);
        break;
    case IDENTITYCONSTRAINT_TYPE :
        // identity constraints should have been parsed already...
        // we should never get here
        break;
    }

    // restore the previous SchemaNamespaceSupport, so that the caller can get
    // proper namespace binding.
    schemaDoc.restoreNSSupport();

    return retObj;
}
 
Example 17
Source File: XSDHandler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
    Object retObj = null;

    DOMUtil.setHidden(decl, fHiddenNodes);
    SchemaNamespaceSupport nsSupport = null;
    // if the parent is <redefine> use the namespace delcs for it.
    Element parent = DOMUtil.getParent(decl);
    if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
        nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
    // back up the current SchemaNamespaceSupport, because we need to provide
    // a fresh one to the traverseGlobal methods.
    schemaDoc.backupNSSupport(nsSupport);

    // traverse the referenced global component
    switch (declType) {
    case TYPEDECL_TYPE :
        if (DOMUtil.getLocalName(decl).equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
            retObj = fComplexTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        else {
            retObj = fSimpleTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        break;
    case ATTRIBUTE_TYPE :
        retObj = fAttributeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ELEMENT_TYPE :
        retObj = fElementTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ATTRIBUTEGROUP_TYPE :
        retObj = fAttributeGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case GROUP_TYPE :
        retObj = fGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case NOTATION_TYPE :
        retObj = fNotationTraverser.traverse(decl, schemaDoc, grammar);
        break;
    case IDENTITYCONSTRAINT_TYPE :
        // identity constraints should have been parsed already...
        // we should never get here
        break;
    }

    // restore the previous SchemaNamespaceSupport, so that the caller can get
    // proper namespace binding.
    schemaDoc.restoreNSSupport();

    return retObj;
}
 
Example 18
Source File: XSDHandler.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
    Object retObj = null;

    DOMUtil.setHidden(decl, fHiddenNodes);
    SchemaNamespaceSupport nsSupport = null;
    // if the parent is <redefine> use the namespace delcs for it.
    Element parent = DOMUtil.getParent(decl);
    if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
        nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
    // back up the current SchemaNamespaceSupport, because we need to provide
    // a fresh one to the traverseGlobal methods.
    schemaDoc.backupNSSupport(nsSupport);

    // traverse the referenced global component
    switch (declType) {
    case TYPEDECL_TYPE :
        if (DOMUtil.getLocalName(decl).equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
            retObj = fComplexTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        else {
            retObj = fSimpleTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        break;
    case ATTRIBUTE_TYPE :
        retObj = fAttributeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ELEMENT_TYPE :
        retObj = fElementTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ATTRIBUTEGROUP_TYPE :
        retObj = fAttributeGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case GROUP_TYPE :
        retObj = fGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case NOTATION_TYPE :
        retObj = fNotationTraverser.traverse(decl, schemaDoc, grammar);
        break;
    case IDENTITYCONSTRAINT_TYPE :
        // identity constraints should have been parsed already...
        // we should never get here
        break;
    }

    // restore the previous SchemaNamespaceSupport, so that the caller can get
    // proper namespace binding.
    schemaDoc.restoreNSSupport();

    return retObj;
}
 
Example 19
Source File: XSDHandler.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
    Object retObj = null;

    DOMUtil.setHidden(decl, fHiddenNodes);
    SchemaNamespaceSupport nsSupport = null;
    // if the parent is <redefine> use the namespace delcs for it.
    Element parent = DOMUtil.getParent(decl);
    if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
        nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
    // back up the current SchemaNamespaceSupport, because we need to provide
    // a fresh one to the traverseGlobal methods.
    schemaDoc.backupNSSupport(nsSupport);

    // traverse the referenced global component
    switch (declType) {
    case TYPEDECL_TYPE :
        if (DOMUtil.getLocalName(decl).equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
            retObj = fComplexTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        else {
            retObj = fSimpleTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        break;
    case ATTRIBUTE_TYPE :
        retObj = fAttributeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ELEMENT_TYPE :
        retObj = fElementTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ATTRIBUTEGROUP_TYPE :
        retObj = fAttributeGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case GROUP_TYPE :
        retObj = fGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case NOTATION_TYPE :
        retObj = fNotationTraverser.traverse(decl, schemaDoc, grammar);
        break;
    case IDENTITYCONSTRAINT_TYPE :
        // identity constraints should have been parsed already...
        // we should never get here
        break;
    }

    // restore the previous SchemaNamespaceSupport, so that the caller can get
    // proper namespace binding.
    schemaDoc.restoreNSSupport();

    return retObj;
}
 
Example 20
Source File: XSDHandler.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
    Object retObj = null;

    DOMUtil.setHidden(decl, fHiddenNodes);
    SchemaNamespaceSupport nsSupport = null;
    // if the parent is <redefine> use the namespace delcs for it.
    Element parent = DOMUtil.getParent(decl);
    if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
        nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
    // back up the current SchemaNamespaceSupport, because we need to provide
    // a fresh one to the traverseGlobal methods.
    schemaDoc.backupNSSupport(nsSupport);

    // traverse the referenced global component
    switch (declType) {
    case TYPEDECL_TYPE :
        if (DOMUtil.getLocalName(decl).equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
            retObj = fComplexTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        else {
            retObj = fSimpleTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        }
        break;
    case ATTRIBUTE_TYPE :
        retObj = fAttributeTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ELEMENT_TYPE :
        retObj = fElementTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case ATTRIBUTEGROUP_TYPE :
        retObj = fAttributeGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case GROUP_TYPE :
        retObj = fGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
        break;
    case NOTATION_TYPE :
        retObj = fNotationTraverser.traverse(decl, schemaDoc, grammar);
        break;
    case IDENTITYCONSTRAINT_TYPE :
        // identity constraints should have been parsed already...
        // we should never get here
        break;
    }

    // restore the previous SchemaNamespaceSupport, so that the caller can get
    // proper namespace binding.
    schemaDoc.restoreNSSupport();

    return retObj;
}