com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl. 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: XSDFACM.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #2
Source File: CMBuilder.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
XSCMValidator createAllCM(XSParticleDecl particle) {
    if (particle.fMaxOccurs == 0)
        return null;

    // get the model group, and add all children of it to the content model
    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
    // create an all content model. the parameter indicates whether
    // the <all> itself is optional
    XSAllCM allContent = new XSAllCM(particle.fMinOccurs == 0, group.fParticleCount);
    for (int i = 0; i < group.fParticleCount; i++) {
        // add the element decl to the all content model
        allContent.addElement((XSElementDecl)group.fParticles[i].fValue,
        group.fParticles[i].fMinOccurs == 0);
    }
    return allContent;
}
 
Example #3
Source File: XSDFACM.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #4
Source File: CMBuilder.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
XSCMValidator createAllCM(XSParticleDecl particle) {
    if (particle.fMaxOccurs == 0)
        return null;

    // get the model group, and add all children of it to the content model
    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
    // create an all content model. the parameter indicates whether
    // the <all> itself is optional
    XSAllCM allContent = new XSAllCM(particle.fMinOccurs == 0, group.fParticleCount);
    for (int i = 0; i < group.fParticleCount; i++) {
        // add the element decl to the all content model
        allContent.addElement((XSElementDecl)group.fParticles[i].fValue,
        group.fParticles[i].fMinOccurs == 0);
    }
    return allContent;
}
 
Example #5
Source File: CMBuilder.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
XSCMValidator createAllCM(XSParticleDecl particle) {
    if (particle.fMaxOccurs == 0)
        return null;

    // get the model group, and add all children of it to the content model
    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
    // create an all content model. the parameter indicates whether
    // the <all> itself is optional
    XSAllCM allContent = new XSAllCM(particle.fMinOccurs == 0, group.fParticleCount);
    for (int i = 0; i < group.fParticleCount; i++) {
        // add the element decl to the all content model
        allContent.addElement((XSElementDecl)group.fParticles[i].fValue,
        group.fParticles[i].fMinOccurs == 0);
    }
    return allContent;
}
 
Example #6
Source File: CMBuilder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
XSCMValidator createAllCM(XSParticleDecl particle) {
    if (particle.fMaxOccurs == 0)
        return null;

    // get the model group, and add all children of it to the content model
    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
    // create an all content model. the parameter indicates whether
    // the <all> itself is optional
    XSAllCM allContent = new XSAllCM(particle.fMinOccurs == 0, group.fParticleCount);
    for (int i = 0; i < group.fParticleCount; i++) {
        // add the element decl to the all content model
        allContent.addElement((XSElementDecl)group.fParticles[i].fValue,
        group.fParticles[i].fMinOccurs == 0);
    }
    return allContent;
}
 
Example #7
Source File: CMBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
XSCMValidator createAllCM(XSParticleDecl particle) {
    if (particle.fMaxOccurs == 0)
        return null;

    // get the model group, and add all children of it to the content model
    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
    // create an all content model. the parameter indicates whether
    // the <all> itself is optional
    XSAllCM allContent = new XSAllCM(particle.fMinOccurs == 0, group.fParticleCount);
    for (int i = 0; i < group.fParticleCount; i++) {
        // add the element decl to the all content model
        allContent.addElement((XSElementDecl)group.fParticles[i].fValue,
        group.fParticles[i].fMinOccurs == 0);
    }
    return allContent;
}
 
Example #8
Source File: XSDFACM.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #9
Source File: CMBuilder.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
XSCMValidator createAllCM(XSParticleDecl particle) {
    if (particle.fMaxOccurs == 0)
        return null;

    // get the model group, and add all children of it to the content model
    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
    // create an all content model. the parameter indicates whether
    // the <all> itself is optional
    XSAllCM allContent = new XSAllCM(particle.fMinOccurs == 0, group.fParticleCount);
    for (int i = 0; i < group.fParticleCount; i++) {
        // add the element decl to the all content model
        allContent.addElement((XSElementDecl)group.fParticles[i].fValue,
        group.fParticles[i].fMinOccurs == 0);
    }
    return allContent;
}
 
Example #10
Source File: CMBuilder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
XSCMValidator createAllCM(XSParticleDecl particle) {
    if (particle.fMaxOccurs == 0)
        return null;

    // get the model group, and add all children of it to the content model
    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
    // create an all content model. the parameter indicates whether
    // the <all> itself is optional
    XSAllCM allContent = new XSAllCM(particle.fMinOccurs == 0, group.fParticleCount);
    for (int i = 0; i < group.fParticleCount; i++) {
        // add the element decl to the all content model
        allContent.addElement((XSElementDecl)group.fParticles[i].fValue,
        group.fParticles[i].fMinOccurs == 0);
    }
    return allContent;
}
 
Example #11
Source File: XSDFACM.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #12
Source File: CMBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
XSCMValidator createAllCM(XSParticleDecl particle) {
    if (particle.fMaxOccurs == 0)
        return null;

    // get the model group, and add all children of it to the content model
    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
    // create an all content model. the parameter indicates whether
    // the <all> itself is optional
    XSAllCM allContent = new XSAllCM(particle.fMinOccurs == 0, group.fParticleCount);
    for (int i = 0; i < group.fParticleCount; i++) {
        // add the element decl to the all content model
        allContent.addElement((XSElementDecl)group.fParticles[i].fValue,
        group.fParticles[i].fMinOccurs == 0);
    }
    return allContent;
}
 
Example #13
Source File: XSDFACM.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #14
Source File: XSDFACM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #15
Source File: XSDFACM.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #16
Source File: CMBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
XSCMValidator createAllCM(XSParticleDecl particle) {
    if (particle.fMaxOccurs == 0)
        return null;

    // get the model group, and add all children of it to the content model
    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
    // create an all content model. the parameter indicates whether
    // the <all> itself is optional
    XSAllCM allContent = new XSAllCM(particle.fMinOccurs == 0, group.fParticleCount);
    for (int i = 0; i < group.fParticleCount; i++) {
        // add the element decl to the all content model
        allContent.addElement((XSElementDecl)group.fParticles[i].fValue,
        group.fParticles[i].fMinOccurs == 0);
    }
    return allContent;
}
 
Example #17
Source File: XSDElementTraverser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Traverse a globally declared element.
 *
 * @param  elmDecl
 * @param  schemaDoc
 * @param  grammar
 * @return the element declaration
 */
XSElementDecl traverseGlobal(Element elmDecl,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // General Attribute Checking'

    Object[] attrValues = fAttrChecker.checkAttributes(elmDecl, true, schemaDoc);
    XSElementDecl element = traverseNamedElement(elmDecl, attrValues, schemaDoc, grammar, true, null);
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);
    return element;

}
 
Example #18
Source File: XSDHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void addGlobalElementDecl(XSElementDecl decl) {
    final String namespace = decl.getNamespace();
    final String declKey = (namespace == null || namespace.length() == 0)
        ? "," + decl.getName() : namespace + "," + decl.getName();

    if (fGlobalElemDecls.get(declKey) == null) {
        fGlobalElemDecls.put(declKey, decl);
    }
}
 
Example #19
Source File: XSDElementTraverser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Traverse a globally declared element.
 *
 * @param  elmDecl
 * @param  schemaDoc
 * @param  grammar
 * @return the element declaration
 */
XSElementDecl traverseGlobal(Element elmDecl,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // General Attribute Checking'

    Object[] attrValues = fAttrChecker.checkAttributes(elmDecl, true, schemaDoc);
    XSElementDecl element = traverseNamedElement(elmDecl, attrValues, schemaDoc, grammar, true, null);
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);
    return element;

}
 
Example #20
Source File: XSDHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected void storeKeyRef (Element keyrefToStore, XSDocumentInfo schemaDoc,
        XSElementDecl currElemDecl) {
    String keyrefName = DOMUtil.getAttrValue(keyrefToStore, SchemaSymbols.ATT_NAME);
    if (keyrefName.length() != 0) {
        String keyrefQName = schemaDoc.fTargetNamespace == null?
                "," + keyrefName: schemaDoc.fTargetNamespace+","+keyrefName;
        checkForDuplicateNames(keyrefQName, IDENTITYCONSTRAINT_TYPE, fUnparsedIdentityConstraintRegistry, fUnparsedIdentityConstraintRegistrySub, keyrefToStore, schemaDoc);
    }
    // now set up all the registries we'll need...

    // check array sizes
    if (fKeyrefStackPos == fKeyrefs.length) {
        Element [] elemArray = new Element [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
        System.arraycopy(fKeyrefs, 0, elemArray, 0, fKeyrefStackPos);
        fKeyrefs = elemArray;
        XSElementDecl [] declArray = new XSElementDecl [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
        System.arraycopy(fKeyrefElems, 0, declArray, 0, fKeyrefStackPos);
        fKeyrefElems = declArray;
        String[][] stringArray = new String [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT][];
        System.arraycopy(fKeyrefNamespaceContext, 0, stringArray, 0, fKeyrefStackPos);
        fKeyrefNamespaceContext = stringArray;

        XSDocumentInfo [] xsDocumentInfo = new XSDocumentInfo [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
        System.arraycopy(fKeyrefsMapXSDocumentInfo, 0, xsDocumentInfo, 0, fKeyrefStackPos);
        fKeyrefsMapXSDocumentInfo = xsDocumentInfo;

    }
    fKeyrefs[fKeyrefStackPos] = keyrefToStore;
    fKeyrefElems[fKeyrefStackPos] = currElemDecl;
    fKeyrefNamespaceContext[fKeyrefStackPos] = schemaDoc.fNamespaceSupport.getEffectiveLocalContext();

    fKeyrefsMapXSDocumentInfo[fKeyrefStackPos++] = schemaDoc;
}
 
Example #21
Source File: XSDElementTraverser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Traverse a globally declared element.
 *
 * @param  elmDecl
 * @param  schemaDoc
 * @param  grammar
 * @return the element declaration
 */
XSElementDecl traverseGlobal(Element elmDecl,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // General Attribute Checking'

    Object[] attrValues = fAttrChecker.checkAttributes(elmDecl, true, schemaDoc);
    XSElementDecl element = traverseNamedElement(elmDecl, attrValues, schemaDoc, grammar, true, null);
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);
    return element;

}
 
Example #22
Source File: XSDHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void addGlobalElementDecl(XSElementDecl decl) {
    final String namespace = decl.getNamespace();
    final String declKey = (namespace == null || namespace.length() == 0)
        ? "," + decl.getName() : namespace + "," + decl.getName();

    if (fGlobalElemDecls.get(declKey) == null) {
        fGlobalElemDecls.put(declKey, decl);
    }
}
 
Example #23
Source File: XSDHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
void addGlobalElementDecl(XSElementDecl decl) {
    final String namespace = decl.getNamespace();
    final String declKey = (namespace == null || namespace.length() == 0)
        ? "," + decl.getName() : namespace + "," + decl.getName();

    if (fGlobalElemDecls.get(declKey) == null) {
        fGlobalElemDecls.put(declKey, decl);
    }
}
 
Example #24
Source File: XSDHandler.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
protected void storeKeyRef (Element keyrefToStore, XSDocumentInfo schemaDoc,
        XSElementDecl currElemDecl) {
    String keyrefName = DOMUtil.getAttrValue(keyrefToStore, SchemaSymbols.ATT_NAME);
    if (keyrefName.length() != 0) {
        String keyrefQName = schemaDoc.fTargetNamespace == null?
                "," + keyrefName: schemaDoc.fTargetNamespace+","+keyrefName;
        checkForDuplicateNames(keyrefQName, IDENTITYCONSTRAINT_TYPE, fUnparsedIdentityConstraintRegistry, fUnparsedIdentityConstraintRegistrySub, keyrefToStore, schemaDoc);
    }
    // now set up all the registries we'll need...

    // check array sizes
    if (fKeyrefStackPos == fKeyrefs.length) {
        Element [] elemArray = new Element [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
        System.arraycopy(fKeyrefs, 0, elemArray, 0, fKeyrefStackPos);
        fKeyrefs = elemArray;
        XSElementDecl [] declArray = new XSElementDecl [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
        System.arraycopy(fKeyrefElems, 0, declArray, 0, fKeyrefStackPos);
        fKeyrefElems = declArray;
        String[][] stringArray = new String [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT][];
        System.arraycopy(fKeyrefNamespaceContext, 0, stringArray, 0, fKeyrefStackPos);
        fKeyrefNamespaceContext = stringArray;

        XSDocumentInfo [] xsDocumentInfo = new XSDocumentInfo [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
        System.arraycopy(fKeyrefsMapXSDocumentInfo, 0, xsDocumentInfo, 0, fKeyrefStackPos);
        fKeyrefsMapXSDocumentInfo = xsDocumentInfo;

    }
    fKeyrefs[fKeyrefStackPos] = keyrefToStore;
    fKeyrefElems[fKeyrefStackPos] = currElemDecl;
    fKeyrefNamespaceContext[fKeyrefStackPos] = schemaDoc.fNamespaceSupport.getEffectiveLocalContext();

    fKeyrefsMapXSDocumentInfo[fKeyrefStackPos++] = schemaDoc;
}
 
Example #25
Source File: XSDElementTraverser.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Traverse a globally declared element.
 *
 * @param  elmDecl
 * @param  schemaDoc
 * @param  grammar
 * @return the element declaration
 */
XSElementDecl traverseGlobal(Element elmDecl,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // General Attribute Checking'

    Object[] attrValues = fAttrChecker.checkAttributes(elmDecl, true, schemaDoc);
    XSElementDecl element = traverseNamedElement(elmDecl, attrValues, schemaDoc, grammar, true, null);
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);
    return element;

}
 
Example #26
Source File: XSDElementTraverser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Traverse a globally declared element.
 *
 * @param  elmDecl
 * @param  schemaDoc
 * @param  grammar
 * @return the element declaration
 */
XSElementDecl traverseGlobal(Element elmDecl,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // General Attribute Checking'

    Object[] attrValues = fAttrChecker.checkAttributes(elmDecl, true, schemaDoc);
    XSElementDecl element = traverseNamedElement(elmDecl, attrValues, schemaDoc, grammar, true, null);
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);
    return element;

}
 
Example #27
Source File: XSDElementTraverser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Traverse a globally declared element.
 *
 * @param  elmDecl
 * @param  schemaDoc
 * @param  grammar
 * @return the element declaration
 */
XSElementDecl traverseGlobal(Element elmDecl,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // General Attribute Checking'

    Object[] attrValues = fAttrChecker.checkAttributes(elmDecl, true, schemaDoc);
    XSElementDecl element = traverseNamedElement(elmDecl, attrValues, schemaDoc, grammar, true, null);
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);
    return element;

}
 
Example #28
Source File: XSDElementTraverser.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Traverse a globally declared element.
 *
 * @param  elmDecl
 * @param  schemaDoc
 * @param  grammar
 * @return the element declaration
 */
XSElementDecl traverseGlobal(Element elmDecl,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // General Attribute Checking'

    Object[] attrValues = fAttrChecker.checkAttributes(elmDecl, true, schemaDoc);
    XSElementDecl element = traverseNamedElement(elmDecl, attrValues, schemaDoc, grammar, true, null);
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);
    return element;

}
 
Example #29
Source File: XSDHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
void addGlobalElementDecl(XSElementDecl decl) {
    final String namespace = decl.getNamespace();
    final String declKey = (namespace == null || namespace.length() == 0)
        ? "," + decl.getName() : namespace + "," + decl.getName();

    if (fGlobalElemDecls.get(declKey) == null) {
        fGlobalElemDecls.put(declKey, decl);
    }
}
 
Example #30
Source File: XSDHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void storeKeyRef (Element keyrefToStore, XSDocumentInfo schemaDoc,
        XSElementDecl currElemDecl) {
    String keyrefName = DOMUtil.getAttrValue(keyrefToStore, SchemaSymbols.ATT_NAME);
    if (keyrefName.length() != 0) {
        String keyrefQName = schemaDoc.fTargetNamespace == null?
                "," + keyrefName: schemaDoc.fTargetNamespace+","+keyrefName;
        checkForDuplicateNames(keyrefQName, IDENTITYCONSTRAINT_TYPE, fUnparsedIdentityConstraintRegistry, fUnparsedIdentityConstraintRegistrySub, keyrefToStore, schemaDoc);
    }
    // now set up all the registries we'll need...

    // check array sizes
    if (fKeyrefStackPos == fKeyrefs.length) {
        Element [] elemArray = new Element [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
        System.arraycopy(fKeyrefs, 0, elemArray, 0, fKeyrefStackPos);
        fKeyrefs = elemArray;
        XSElementDecl [] declArray = new XSElementDecl [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
        System.arraycopy(fKeyrefElems, 0, declArray, 0, fKeyrefStackPos);
        fKeyrefElems = declArray;
        String[][] stringArray = new String [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT][];
        System.arraycopy(fKeyrefNamespaceContext, 0, stringArray, 0, fKeyrefStackPos);
        fKeyrefNamespaceContext = stringArray;

        XSDocumentInfo [] xsDocumentInfo = new XSDocumentInfo [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
        System.arraycopy(fKeyrefsMapXSDocumentInfo, 0, xsDocumentInfo, 0, fKeyrefStackPos);
        fKeyrefsMapXSDocumentInfo = xsDocumentInfo;

    }
    fKeyrefs[fKeyrefStackPos] = keyrefToStore;
    fKeyrefElems[fKeyrefStackPos] = currElemDecl;
    fKeyrefNamespaceContext[fKeyrefStackPos] = schemaDoc.fNamespaceSupport.getEffectiveLocalContext();

    fKeyrefsMapXSDocumentInfo[fKeyrefStackPos++] = schemaDoc;
}