Package org.apache.xerces.impl.xs

Examples of org.apache.xerces.impl.xs.XSModelGroupImpl


        XSParticleDecl particle = new XSParticleDecl();
        particle.fType = XSParticleDecl.PARTICLE_WILDCARD;
        particle.fValue = getErrorWildcard();
        particle.fMinOccurs = 0;
        particle.fMaxOccurs = SchemaSymbols.OCCURRENCE_UNBOUNDED;
        XSModelGroupImpl group = new XSModelGroupImpl();
        group.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
        group.fParticleCount = 1;
        group.fParticles = new XSParticleDecl[1];
        group.fParticles[0] = particle;
        XSParticleDecl errorContent = new XSParticleDecl();
View Full Code Here


        XSParticle particle = complexTypeDecl.getParticle();
        if (derivationMethod == XSConstants.DERIVATION_EXTENSION) {
            XSTerm particleTerm = null;
            if (particle != null) {
              particleTerm = particle.getTerm();
              XSModelGroupImpl modelGroup = (XSModelGroupImpl) particleTerm;
              if (modelGroup.fParticles.length == 2) {
                 particle = modelGroup.fParticles[1]
              }
            }            
        }
View Full Code Here

       
        XInt minAtt = (XInt)attrValues[XSAttributeChecker.ATTIDX_MINOCCURS];
        XInt maxAtt = (XInt)attrValues[XSAttributeChecker.ATTIDX_MAXOCCURS];
        Long defaultVals = (Long)attrValues[XSAttributeChecker.ATTIDX_FROMDEFAULT];
       
        XSModelGroupImpl group = new XSModelGroupImpl();
        group.fCompositor = choice ? XSModelGroupImpl.MODELGROUP_CHOICE : XSModelGroupImpl.MODELGROUP_SEQUENCE;
        group.fParticleCount = fPArray.getParticleCount();
        group.fParticles = fPArray.popContext();
        XSObjectList annotations;
        if (annotation != null) {
View Full Code Here

            XSParticleDecl particle = new XSParticleDecl();
            particle.fType = XSParticleDecl.PARTICLE_WILDCARD;
            particle.fValue = getErrorWildcard();
            particle.fMinOccurs = 0;
            particle.fMaxOccurs = SchemaSymbols.OCCURRENCE_UNBOUNDED;
            XSModelGroupImpl group = new XSModelGroupImpl();
            group.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
            group.fParticleCount = 1;
            group.fParticles = new XSParticleDecl[1];
            group.fParticles[0] = particle;
            XSParticleDecl errorContent = new XSParticleDecl();
View Full Code Here

                        if (fParticle.fMinOccurs != baseContent.fMinOccurs) {
                            throw new ComplexTypeRecoverableError("cos-particle-extends.3.1",
                                    new Object[]{}, complexContent);
                        }

                        XSModelGroupImpl group = new XSModelGroupImpl();
                        group.fCompositor = XSModelGroupImpl.MODELGROUP_ALL;
                        group.fParticleCount = ((XSModelGroupImpl)baseContent.fValue).fParticleCount + ((XSModelGroupImpl)fParticle.fValue).fParticleCount;
                        group.fParticles = new XSParticleDecl[group.fParticleCount];
                        System.arraycopy(((XSModelGroupImpl)baseContent.fValue).fParticles, 0, group.fParticles, 0, ((XSModelGroupImpl)baseContent.fValue).fParticleCount);
                        System.arraycopy(((XSModelGroupImpl)fParticle.fValue).fParticles, 0, group.fParticles, ((XSModelGroupImpl)baseContent.fValue).fParticleCount, ((XSModelGroupImpl)fParticle.fValue).fParticleCount);
                        group.fAnnotations = XSObjectListImpl.EMPTY_LIST;
                        // the particle to contain the above all
                        XSParticleDecl particle = new XSParticleDecl();
                        particle.fType = XSParticleDecl.PARTICLE_MODELGROUP;
                        particle.fValue = group;
                        particle.fAnnotations = XSObjectListImpl.EMPTY_LIST;
                        particle.fMinOccurs = fParticle.fMinOccurs;

                        fParticle = particle;
                        explicitOpenContent = (XSOpenContentDecl) baseType.getOpenContent();
                    }
                    else {
                        fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
                        fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
                        throw new ComplexTypeRecoverableError("cos-all-limited.1.2",
                                new Object[]{}, complexContent);
                    }
                }
                // the "sequence" model group to contain both particles
                else {
                    XSModelGroupImpl group = new XSModelGroupImpl();
                    group.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
                    group.fParticleCount = 2;
                    group.fParticles = new XSParticleDecl[2];
                    group.fParticles[0] = (XSParticleDecl)baseType.getParticle();
                    group.fParticles[1] = fParticle;
View Full Code Here

            }
            else if (childName.equals(SchemaSymbols.ELT_SEQUENCE)) {
                particle = traverseSequence(complexContentChild,schemaDoc,grammar,
                        NOT_ALL_CONTEXT,fComplexTypeDecl);
                if (particle != null) {
                    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
                    if (group.fParticleCount == 0)
                        emptyParticle = true;
                }
                attrOrAssertNode = DOMUtil.getNextSiblingElement(complexContentChild);
            }
            else if (childName.equals(SchemaSymbols.ELT_CHOICE)) {
                particle = traverseChoice(complexContentChild,schemaDoc,grammar,
                        NOT_ALL_CONTEXT,fComplexTypeDecl);
                if (particle != null && particle.fMinOccurs == 0) {
                    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
                    if (group.fParticleCount == 0)
                        emptyParticle = true;
                }
                attrOrAssertNode = DOMUtil.getNextSiblingElement(complexContentChild);
            }
            else if (childName.equals(SchemaSymbols.ELT_ALL)) {
                particle = traverseAll(complexContentChild,schemaDoc,grammar,
                        PROCESSING_ALL_GP,fComplexTypeDecl);
                if (particle != null) {
                    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
                    if (group.fParticleCount == 0)
                        emptyParticle = true;
                }
                attrOrAssertNode = DOMUtil.getNextSiblingElement(complexContentChild);
            }
View Full Code Here

        particle = null;
        XInt minAtt = (XInt)attrValues[XSAttributeChecker.ATTIDX_MINOCCURS];
        XInt maxAtt = (XInt)attrValues[XSAttributeChecker.ATTIDX_MAXOCCURS];
        Long defaultVals = (Long)attrValues[XSAttributeChecker.ATTIDX_FROMDEFAULT];
       
        XSModelGroupImpl group = new XSModelGroupImpl();
        group.fCompositor = XSModelGroupImpl.MODELGROUP_ALL;
        group.fParticleCount = fPArray.getParticleCount();
        group.fParticles = fPArray.popContext();
        XSObjectList annotations;
        if (annotation != null) {
View Full Code Here

     * the input particle (method argument) recursively.
     */
    private void expandGroupParticleForCompositorAll(XSParticleDecl particle,
                                                     Element contextElement) {
       
        XSModelGroupImpl group = (XSModelGroupImpl) particle.fValue;
        if (group.getCompositor() == XSModelGroup.COMPOSITOR_ALL) {
            XSParticleDecl[] subParticles = group.fParticles;
            for (int partlIdx = 0; partlIdx < group.fParticleCount; partlIdx++) {
               short particleType = subParticles[partlIdx].fType;
               if (particleType == XSParticleDecl.PARTICLE_ELEMENT  ||
                   particleType == XSParticleDecl.PARTICLE_WILDCARD) {
                     fPArray.addParticle(subParticles[partlIdx]);
               }
               else {
                   // the sub particle is a model-group. call the method recursively.
                   expandGroupParticleForCompositorAll(subParticles[partlIdx], contextElement);
               }
            }
        }
        else {
            String wrongCompsName = (group.getCompositor() == XSModelGroup.COMPOSITOR_SEQUENCE) ?
                                     "xs:"+SchemaSymbols.ELT_SEQUENCE : "xs:"+SchemaSymbols.ELT_CHOICE;
            // it's an error to have a non-all (xs:all) compositor within "xs:all -> xs:group"
            reportSchemaError("cos-all-limited.2-xs11", new Object[] { wrongCompsName }, contextElement);
        }
       
View Full Code Here

        XSParticle particle = complexTypeDecl.getParticle();
        if (derivationMethod == XSConstants.DERIVATION_EXTENSION) {
            XSTerm particleTerm = null;
            if (particle != null) {
              particleTerm = particle.getTerm();
              XSModelGroupImpl modelGroup = (XSModelGroupImpl) particleTerm;
              if (modelGroup.fParticles.length == 2) {
                 particle = modelGroup.fParticles[1]
              }
            }            
        }
View Full Code Here

            XSDocumentInfo currSchema = fLocalElementDecl_schema[i];
            SchemaGrammar currGrammar = fGrammarBucket.getGrammar(currSchema.fTargetNamespace);
            fElementTraverser.traverseLocal (fParticle[i], currElem, currSchema, currGrammar, fAllContext[i], fParent[i], fLocalElemNamespaceContext[i]);
            // If it's an empty particle, remove it from the containing component.
            if (fParticle[i].fType == XSParticleDecl.PARTICLE_EMPTY) {
                XSModelGroupImpl group = null;
                if (fParent[i] instanceof XSComplexTypeDecl) {
                    XSParticle p = ((XSComplexTypeDecl)fParent[i]).getParticle();
                    if (p != null)
                        group = (XSModelGroupImpl)p.getTerm();
                }
View Full Code Here

TOP

Related Classes of org.apache.xerces.impl.xs.XSModelGroupImpl

Copyright © 2018 www.massapicom. 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.