com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl

Here are the examples of the java api class com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl taken from open source projects.

1. XSModelImpl#buildSubGroups()

Project: openjdk
Source File: XSModelImpl.java
View license
private SymbolHash buildSubGroups() {
    SubstitutionGroupHandler sgHandler = new SubstitutionGroupHandler(null);
    for (int i = 0; i < fGrammarCount; i++) {
        sgHandler.addSubstitutionGroup(fGrammarList[i].getSubstitutionGroups());
    }
    final XSObjectListImpl elements = getGlobalElements();
    final int len = elements.getLength();
    final SymbolHash subGroupMap = new SymbolHash(len * 2);
    XSElementDecl head;
    XSElementDeclaration[] subGroup;
    for (int i = 0; i < len; i++) {
        head = (XSElementDecl) elements.item(i);
        subGroup = sgHandler.getSubstitutionGroup(head);
        subGroupMap.put(head, subGroup.length > 0 ? new XSObjectListImpl(subGroup, subGroup.length) : XSObjectListImpl.EMPTY_LIST);
    }
    return subGroupMap;
}

2. XSModelImpl#getAnnotations()

Project: openjdk
Source File: XSModelImpl.java
View license
/**
     *  [annotations]: a set of annotations if it exists, otherwise an empty
     * <code>XSObjectList</code>.
     */
public synchronized XSObjectList getAnnotations() {
    if (fAnnotations != null) {
        return fAnnotations;
    }
    // do this in two passes to avoid inaccurate array size
    int totalAnnotations = 0;
    for (int i = 0; i < fGrammarCount; i++) {
        totalAnnotations += fGrammarList[i].fNumAnnotations;
    }
    if (totalAnnotations == 0) {
        fAnnotations = XSObjectListImpl.EMPTY_LIST;
        return fAnnotations;
    }
    XSAnnotationImpl[] annotations = new XSAnnotationImpl[totalAnnotations];
    int currPos = 0;
    for (int i = 0; i < fGrammarCount; i++) {
        SchemaGrammar currGrammar = fGrammarList[i];
        if (currGrammar.fNumAnnotations > 0) {
            System.arraycopy(currGrammar.fAnnotations, 0, annotations, currPos, currGrammar.fNumAnnotations);
            currPos += currGrammar.fNumAnnotations;
        }
    }
    fAnnotations = new XSObjectListImpl(annotations, annotations.length);
    return fAnnotations;
}