com.sun.org.apache.xerces.internal.impl.dtd.models.ContentModelValidator

Here are the examples of the java api class com.sun.org.apache.xerces.internal.impl.dtd.models.ContentModelValidator taken from open source projects.

1. DTDGrammar#resize()

Project: openjdk
File: DTDGrammar.java
private static ContentModelValidator[][] resize(ContentModelValidator array[][], int newsize) {
    ContentModelValidator newarray[][] = new ContentModelValidator[newsize][];
    System.arraycopy(array, 0, newarray, 0, array.length);
    return newarray;
}

2. DTDGrammar#getElementContentModelValidator()

Project: openjdk
File: DTDGrammar.java
/**
     * getElementContentModelValidator
     *
     * @param elementDeclIndex
     *
     * @return its ContentModelValidator if any.
     */
protected ContentModelValidator getElementContentModelValidator(int elementDeclIndex) {
    int chunk = elementDeclIndex >> CHUNK_SHIFT;
    int index = elementDeclIndex & CHUNK_MASK;
    ContentModelValidator contentModel = fElementDeclContentModelValidator[chunk][index];
    // If we have one, just return that. Otherwise, gotta create one
    if (contentModel != null) {
        return contentModel;
    }
    int contentType = fElementDeclType[chunk][index];
    if (contentType == XMLElementDecl.TYPE_SIMPLE) {
        return null;
    }
    // Get the type of content this element has
    int contentSpecIndex = fElementDeclContentSpecIndex[chunk][index];
    /***
        if ( contentSpecIndex == -1 )
            return null;
        /***/
    XMLContentSpec contentSpec = new XMLContentSpec();
    getContentSpec(contentSpecIndex, contentSpec);
    // And create the content model according to the spec type
    if (contentType == XMLElementDecl.TYPE_MIXED) {
        //
        //  Just create a mixel content model object. This type of
        //  content model is optimized for mixed content validation.
        //
        ChildrenList children = new ChildrenList();
        contentSpecTree(contentSpecIndex, contentSpec, children);
        contentModel = new MixedContentModel(children.qname, children.type, 0, children.length, false);
    } else if (contentType == XMLElementDecl.TYPE_CHILDREN) {
        //  This method will create an optimal model for the complexity
        //  of the element's defined model. If its simple, it will create
        //  a SimpleContentModel object. If its a simple list, it will
        //  create a SimpleListContentModel object. If its complex, it
        //  will create a DFAContentModel object.
        //
        contentModel = createChildModel(contentSpecIndex);
    } else {
        throw new RuntimeException("Unknown content type for a element decl " + "in getElementContentModelValidator() in AbstractDTDGrammar class");
    }
    // Add the new model to the content model for this element
    fElementDeclContentModelValidator[chunk][index] = contentModel;
    return contentModel;
}