Examples of XMLContentModel


Examples of org.apache.xerces.validators.common.XMLContentModel

            return null;

        int chunk = elementDeclIndex >> CHUNK_SHIFT;
        int index = elementDeclIndex & CHUNK_MASK;

        XMLContentModel contentModel    =  fElementDeclContentModelValidator[chunk][index];

        // If we have one, just return that. Otherwise, gotta create one
        if (contentModel != null)
            return contentModel;
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }

    private XMLContentModel[][] resize(XMLContentModel array[][], int newsize) {
        XMLContentModel newarray[][] = new XMLContentModel[newsize][];
        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

            return null;

        int chunk = elementDeclIndex >> CHUNK_SHIFT;
        int index = elementDeclIndex & CHUNK_MASK;

        XMLContentModel 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 = convertContentSpecTree(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_SIMPLE ) {
              //
              //  just create a mixed content model object. This type of
              //  content model is optimized for simple mixed content validation.
              //

              Vector vQName = new Vector();
              try {
                  ChildrenList children = new ChildrenList();
                  contentSpecTree(contentSpecIndex, contentSpec, children);
                  contentModel = new MixedContentModel(children.qname,
                                                       children.type,
                                                       0, children.length, false, isDTD());
              }catchCMException ex ){
                  ex.printStackTrace();
              }
        }
        else if (contentType == XMLElementDecl.TYPE_MIXED_COMPLEX) {
              //
              // For Schema, we need a more complex model.   Create a child model as
              // per the element-only case, unless there are actually no children in
              // the model.  If that's the case, we can use the Mixed Content Model for
              // DTDs. 
              try {
                contentModel = createChildModel(contentSpecIndex, true);
              }
              catch (CMException ex) {
                ex.printStackTrace();
              }
        }
           

        else if (contentType == XMLElementDecl.TYPE_CHILDREN) {
            //  This method will create an optimal model for the complexity
            //  of the element's defined model. If it's simple, it will create
            //  a SimpleContentModel object. If it's a simple list, it will
            //  create a SimpleListContentModel object. If it's complex, it
            //  will create a DFAContentModel object.
            //
            try {
            contentModel = createChildModel(contentSpecIndex, false);
            }catch( CMException ex ) {
                 ex.printStackTrace();
            }
        } else {
            throw new CMException(ImplementationMessages.VAL_CST);
        }

        // Add the new model to the content model for this element

        fElementDeclContentModelValidator[chunk][index] = contentModel;

        //build it  ..... in XMLValidator
        if (contentModel != null)
            contentModel.setSubstitutionGroupComparator(comparator);

        return contentModel;
    }
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }

    private XMLContentModel[][] resize(XMLContentModel array[][], int newsize) {
        XMLContentModel newarray[][] = new XMLContentModel[newsize][];
        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

        // if it's not there, we create a new one, do UPA checking,
        // then throw it away. because UPA checking might result in NFA,
        // but we need DFA for further checking
        if (checkUniqueParticleAttribution) {
            checkingUPA = true;
            XMLContentModel contentModel = super.getElementContentModel(elementDeclIndex, comparator);
            checkingUPA = false;

            if (contentModel != null) {
                contentModel.checkUniqueParticleAttribution(this);
                clearElementContentModel(elementDeclIndex);
            }
        }

        return super.getElementContentModel(elementDeclIndex, comparator);;
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

            return null;

        int chunk = contentSpecIndex >> CHUNK_SHIFT;
        int index = contentSpecIndex & CHUNK_MASK;

        XMLContentModel contentModel = fContentSpecValidator[chunk][index];

        // If we have one, just return that. Otherwise, gotta create one
        if (contentModel != null)
            return contentModel;

        if (contentType == XMLElementDecl.TYPE_SIMPLE) {
            return null;
        }

        // Get the type of content this element has
        int expendedIndex = convertContentSpecTree(contentSpecIndex);

        XMLContentSpec  contentSpec = new XMLContentSpec();
        getContentSpec( expendedIndex, contentSpec );

        // And create the content model according to the spec type

        if ( contentType == XMLElementDecl.TYPE_MIXED_SIMPLE ) {
              //
              //  just create a mixed content model object. This type of
              //  content model is optimized for simple mixed content validation.
              //

              Vector vQName = new Vector();
              ChildrenList children = new ChildrenList();
              contentSpecTree(expendedIndex, contentSpec, children);
              contentModel = new MixedContentModel(children.qname,
                                                   children.type,
                                                   0, children.length, false, isDTD());
        }
        else if (contentType == XMLElementDecl.TYPE_MIXED_COMPLEX) {
              //
              // For Schema, we need a more complex model.   Create a child model as
              // per the element-only case, unless there are actually no children in
              // the model.  If that's the case, we can use the Mixed Content Model for
              // DTDs.
              contentModel = createChildModel(expendedIndex, true);
        }


        else if (contentType == XMLElementDecl.TYPE_CHILDREN) {
            //  This method will create an optimal model for the complexity
            //  of the element's defined model. If it's simple, it will create
            //  a SimpleContentModel object. If it's a simple list, it will
            //  create a SimpleListContentModel object. If it's complex, it
            //  will create a DFAContentModel object.
            //
            contentModel = createChildModel(expendedIndex, false);
        } else {
            throw new CMException(ImplementationMessages.VAL_CST);
        }

        // Add the new model to the content model for this element

        fContentSpecValidator[chunk][index] = contentModel;

        //build it  ..... in XMLValidator
        if (contentModel != null)
            contentModel.setSubstitutionGroupComparator(comparator);

        return contentModel;
    }
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }

    private XMLContentModel[][] resize(XMLContentModel array[][], int newsize) {
        XMLContentModel newarray[][] = new XMLContentModel[newsize][];
        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

        // if it's not there, we create a new one, do UPA checking,
        // then throw it away. because UPA checking might result in NFA,
        // but we need DFA for further checking
        if (checkUniqueParticleAttribution) {
            checkingUPA = true;
            XMLContentModel contentModel = super.getContentModel(contentSpecIndex, contentType, comparator);
            checkingUPA = false;

            if (contentModel != null) {
                contentModel.checkUniqueParticleAttribution(this);
                clearContentModel(contentSpecIndex);
            }
        }

        return super.getContentModel(contentSpecIndex, contentType, comparator);
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

            return null;

        int chunk = contentSpecIndex >> CHUNK_SHIFT;
        int index = contentSpecIndex & CHUNK_MASK;

        XMLContentModel contentModel = fContentSpecValidator[chunk][index];

        // If we have one, just return that. Otherwise, gotta create one
        if (contentModel != null)
            return contentModel;

        if (contentType == XMLElementDecl.TYPE_SIMPLE) {
            return null;
        }

        // Get the type of content this element has
        int expendedIndex = convertContentSpecTree(contentSpecIndex);

        XMLContentSpec  contentSpec = new XMLContentSpec();
        getContentSpec( expendedIndex, contentSpec );

        // And create the content model according to the spec type

        if ( contentType == XMLElementDecl.TYPE_MIXED_SIMPLE ) {
              //
              //  just create a mixed content model object. This type of
              //  content model is optimized for simple mixed content validation.
              //

              Vector vQName = new Vector();
              ChildrenList children = new ChildrenList();
              contentSpecTree(expendedIndex, contentSpec, children);
              contentModel = new MixedContentModel(children.qname,
                                                   children.type,
                                                   0, children.length, false, isDTD());
        }
        else if (contentType == XMLElementDecl.TYPE_MIXED_COMPLEX) {
              //
              // For Schema, we need a more complex model.   Create a child model as
              // per the element-only case, unless there are actually no children in
              // the model.  If that's the case, we can use the Mixed Content Model for
              // DTDs.
              contentModel = createChildModel(expendedIndex, true);
        }


        else if (contentType == XMLElementDecl.TYPE_CHILDREN) {
            //  This method will create an optimal model for the complexity
            //  of the element's defined model. If it's simple, it will create
            //  a SimpleContentModel object. If it's a simple list, it will
            //  create a SimpleListContentModel object. If it's complex, it
            //  will create a DFAContentModel object.
            //
            contentModel = createChildModel(expendedIndex, false);
        } else {
            throw new CMException(ImplementationMessages.VAL_CST);
        }

        // Add the new model to the content model for this element

        fContentSpecValidator[chunk][index] = contentModel;

        //build it  ..... in XMLValidator
        if (contentModel != null)
            contentModel.setSubstitutionGroupComparator(comparator);

        return contentModel;
    }
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }

    private XMLContentModel[][] resize(XMLContentModel array[][], int newsize) {
        XMLContentModel newarray[][] = new XMLContentModel[newsize][];
        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.