Java Code Examples for com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl#PARTICLE_MODELGROUP

The following examples show how to use com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl#PARTICLE_MODELGROUP . 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: XSDHandler.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private boolean removeParticle(XSModelGroupImpl group, XSParticleDecl particle) {
    XSParticleDecl member;
    for (int i = 0; i < group.fParticleCount; i++) {
        member = group.fParticles[i];
        if (member == particle) {
            for (int j = i; j < group.fParticleCount-1; j++)
                group.fParticles[j] = group.fParticles[j+1];
            group.fParticleCount--;
            return true;
        }
        if (member.fType == XSParticleDecl.PARTICLE_MODELGROUP) {
            if (removeParticle((XSModelGroupImpl)member.fValue, particle))
                return true;
        }
    }
    return false;
}
 
Example 2
Source File: XSDComplexTypeTraverser.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private static XSParticleDecl getErrorContent() {
    if (fErrorContent == null) {
        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();
        errorContent.fType = XSParticleDecl.PARTICLE_MODELGROUP;
        errorContent.fValue = group;
        fErrorContent = errorContent;
    }
    return fErrorContent;
}
 
Example 3
Source File: CMBuilder.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private boolean useRepeatingLeafNodes(XSParticleDecl particle) {
    int maxOccurs = particle.fMaxOccurs;
    int minOccurs = particle.fMinOccurs;
    short type = particle.fType;

    if (type == XSParticleDecl.PARTICLE_MODELGROUP) {
        XSModelGroupImpl group = (XSModelGroupImpl) particle.fValue;
        if (minOccurs != 1 || maxOccurs != 1) {
            if (group.fParticleCount == 1) {
                XSParticleDecl particle2 = (XSParticleDecl) group.fParticles[0];
                short type2 = particle2.fType;
                return ((type2 == XSParticleDecl.PARTICLE_ELEMENT ||
                        type2 == XSParticleDecl.PARTICLE_WILDCARD) &&
                        particle2.fMinOccurs == 1 &&
                        particle2.fMaxOccurs == 1);
            }
            return (group.fParticleCount == 0);
        }
        for (int i = 0; i < group.fParticleCount; ++i) {
            if (!useRepeatingLeafNodes(group.fParticles[i])) {
                return false;
            }
        }
    }
    return true;
}
 
Example 4
Source File: XSDHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private boolean removeParticle(XSModelGroupImpl group, XSParticleDecl particle) {
    XSParticleDecl member;
    for (int i = 0; i < group.fParticleCount; i++) {
        member = group.fParticles[i];
        if (member == particle) {
            for (int j = i; j < group.fParticleCount-1; j++)
                group.fParticles[j] = group.fParticles[j+1];
            group.fParticleCount--;
            return true;
        }
        if (member.fType == XSParticleDecl.PARTICLE_MODELGROUP) {
            if (removeParticle((XSModelGroupImpl)member.fValue, particle))
                return true;
        }
    }
    return false;
}
 
Example 5
Source File: XSDComplexTypeTraverser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private static XSParticleDecl getErrorContent() {
    if (fErrorContent == null) {
        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();
        errorContent.fType = XSParticleDecl.PARTICLE_MODELGROUP;
        errorContent.fValue = group;
        fErrorContent = errorContent;
    }
    return fErrorContent;
}
 
Example 6
Source File: CMBuilder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private boolean useRepeatingLeafNodes(XSParticleDecl particle) {
    int maxOccurs = particle.fMaxOccurs;
    int minOccurs = particle.fMinOccurs;
    short type = particle.fType;

    if (type == XSParticleDecl.PARTICLE_MODELGROUP) {
        XSModelGroupImpl group = (XSModelGroupImpl) particle.fValue;
        if (minOccurs != 1 || maxOccurs != 1) {
            if (group.fParticleCount == 1) {
                XSParticleDecl particle2 = (XSParticleDecl) group.fParticles[0];
                short type2 = particle2.fType;
                return ((type2 == XSParticleDecl.PARTICLE_ELEMENT ||
                        type2 == XSParticleDecl.PARTICLE_WILDCARD) &&
                        particle2.fMinOccurs == 1 &&
                        particle2.fMaxOccurs == 1);
            }
            return (group.fParticleCount == 0);
        }
        for (int i = 0; i < group.fParticleCount; ++i) {
            if (!useRepeatingLeafNodes(group.fParticles[i])) {
                return false;
            }
        }
    }
    return true;
}
 
Example 7
Source File: CMBuilder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private boolean useRepeatingLeafNodes(XSParticleDecl particle) {
    int maxOccurs = particle.fMaxOccurs;
    int minOccurs = particle.fMinOccurs;
    short type = particle.fType;

    if (type == XSParticleDecl.PARTICLE_MODELGROUP) {
        XSModelGroupImpl group = (XSModelGroupImpl) particle.fValue;
        if (minOccurs != 1 || maxOccurs != 1) {
            if (group.fParticleCount == 1) {
                XSParticleDecl particle2 = (XSParticleDecl) group.fParticles[0];
                short type2 = particle2.fType;
                return ((type2 == XSParticleDecl.PARTICLE_ELEMENT ||
                        type2 == XSParticleDecl.PARTICLE_WILDCARD) &&
                        particle2.fMinOccurs == 1 &&
                        particle2.fMaxOccurs == 1);
            }
            return (group.fParticleCount == 0);
        }
        for (int i = 0; i < group.fParticleCount; ++i) {
            if (!useRepeatingLeafNodes(group.fParticles[i])) {
                return false;
            }
        }
    }
    return true;
}
 
Example 8
Source File: XSDComplexTypeTraverser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private static XSParticleDecl getErrorContent() {
    if (fErrorContent == null) {
        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();
        errorContent.fType = XSParticleDecl.PARTICLE_MODELGROUP;
        errorContent.fValue = group;
        fErrorContent = errorContent;
    }
    return fErrorContent;
}
 
Example 9
Source File: CMBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private boolean useRepeatingLeafNodes(XSParticleDecl particle) {
    int maxOccurs = particle.fMaxOccurs;
    int minOccurs = particle.fMinOccurs;
    short type = particle.fType;

    if (type == XSParticleDecl.PARTICLE_MODELGROUP) {
        XSModelGroupImpl group = (XSModelGroupImpl) particle.fValue;
        if (minOccurs != 1 || maxOccurs != 1) {
            if (group.fParticleCount == 1) {
                XSParticleDecl particle2 = (XSParticleDecl) group.fParticles[0];
                short type2 = particle2.fType;
                return ((type2 == XSParticleDecl.PARTICLE_ELEMENT ||
                        type2 == XSParticleDecl.PARTICLE_WILDCARD) &&
                        particle2.fMinOccurs == 1 &&
                        particle2.fMaxOccurs == 1);
            }
            return (group.fParticleCount == 0);
        }
        for (int i = 0; i < group.fParticleCount; ++i) {
            if (!useRepeatingLeafNodes(group.fParticles[i])) {
                return false;
            }
        }
    }
    return true;
}
 
Example 10
Source File: XSDComplexTypeTraverser.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private static XSParticleDecl getErrorContent() {
    if (fErrorContent == null) {
        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();
        errorContent.fType = XSParticleDecl.PARTICLE_MODELGROUP;
        errorContent.fValue = group;
        fErrorContent = errorContent;
    }
    return fErrorContent;
}
 
Example 11
Source File: XSDAbstractParticleTraverser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected boolean hasAllContent(XSParticleDecl particle) {
    // If the content is not empty, is the top node ALL?
    if (particle != null && particle.fType == XSParticleDecl.PARTICLE_MODELGROUP) {
        return ((XSModelGroupImpl)particle.fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL;
    }

    return false;
}
 
Example 12
Source File: XSDAbstractParticleTraverser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected boolean hasAllContent(XSParticleDecl particle) {
    // If the content is not empty, is the top node ALL?
    if (particle != null && particle.fType == XSParticleDecl.PARTICLE_MODELGROUP) {
        return ((XSModelGroupImpl)particle.fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL;
    }

    return false;
}
 
Example 13
Source File: XSDAbstractParticleTraverser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected boolean hasAllContent(XSParticleDecl particle) {
    // If the content is not empty, is the top node ALL?
    if (particle != null && particle.fType == XSParticleDecl.PARTICLE_MODELGROUP) {
        return ((XSModelGroupImpl)particle.fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL;
    }

    return false;
}
 
Example 14
Source File: CMBuilder.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Get content model for the a given type
 *
 * @param typeDecl  get content model for which complex type
 * @param forUPA    a flag indicating whether it is for UPA
 * @return          a content model validator
 */
public XSCMValidator getContentModel(XSComplexTypeDecl typeDecl, boolean forUPA) {

    // for complex type with empty or simple content,
    // there is no content model validator
    short contentType = typeDecl.getContentType();
    if (contentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE ||
        contentType == XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
        return null;
    }

    XSParticleDecl particle = (XSParticleDecl)typeDecl.getParticle();

    // if the content is element only or mixed, but no particle
    // is defined, return the empty content model
    if (particle == null)
        return fEmptyCM;

    // if the content model contains "all" model group,
    // we create an "all" content model, otherwise a DFA content model
    XSCMValidator cmValidator = null;
    if (particle.fType == XSParticleDecl.PARTICLE_MODELGROUP &&
        ((XSModelGroupImpl)particle.fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL) {
        cmValidator = createAllCM(particle);
    }
    else {
        cmValidator = createDFACM(particle, forUPA);
    }

    //now we are throught building content model and have passed sucessfully of the nodecount check
    //if set by the application
    fNodeFactory.resetNodeCount() ;

    // if the validator returned is null, it means there is nothing in
    // the content model, so we return the empty content model.
    if (cmValidator == null)
        cmValidator = fEmptyCM;

    return cmValidator;
}
 
Example 15
Source File: CMBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get content model for the a given type
 *
 * @param typeDecl  get content model for which complex type
 * @return          a content model validator
 */
public XSCMValidator getContentModel(XSComplexTypeDecl typeDecl) {

    // for complex type with empty or simple content,
    // there is no content model validator
    short contentType = typeDecl.getContentType();
    if (contentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE ||
        contentType == XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
        return null;
    }

    XSParticleDecl particle = (XSParticleDecl)typeDecl.getParticle();

    // if the content is element only or mixed, but no particle
    // is defined, return the empty content model
    if (particle == null)
        return fEmptyCM;

    // if the content model contains "all" model group,
    // we create an "all" content model, otherwise a DFA content model
    XSCMValidator cmValidator = null;
    if (particle.fType == XSParticleDecl.PARTICLE_MODELGROUP &&
        ((XSModelGroupImpl)particle.fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL) {
        cmValidator = createAllCM(particle);
    }
    else {
        cmValidator = createDFACM(particle);
    }

    //now we are throught building content model and have passed sucessfully of the nodecount check
    //if set by the application
    fNodeFactory.resetNodeCount() ;

    // if the validator returned is null, it means there is nothing in
    // the content model, so we return the empty content model.
    if (cmValidator == null)
        cmValidator = fEmptyCM;

    return cmValidator;
}
 
Example 16
Source File: XSDAbstractParticleTraverser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected boolean hasAllContent(XSParticleDecl particle) {
    // If the content is not empty, is the top node ALL?
    if (particle != null && particle.fType == XSParticleDecl.PARTICLE_MODELGROUP) {
        return ((XSModelGroupImpl)particle.fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL;
    }

    return false;
}
 
Example 17
Source File: CMBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get content model for the a given type
 *
 * @param typeDecl  get content model for which complex type
 * @return          a content model validator
 */
public XSCMValidator getContentModel(XSComplexTypeDecl typeDecl) {

    // for complex type with empty or simple content,
    // there is no content model validator
    short contentType = typeDecl.getContentType();
    if (contentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE ||
        contentType == XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
        return null;
    }

    XSParticleDecl particle = (XSParticleDecl)typeDecl.getParticle();

    // if the content is element only or mixed, but no particle
    // is defined, return the empty content model
    if (particle == null)
        return fEmptyCM;

    // if the content model contains "all" model group,
    // we create an "all" content model, otherwise a DFA content model
    XSCMValidator cmValidator = null;
    if (particle.fType == XSParticleDecl.PARTICLE_MODELGROUP &&
        ((XSModelGroupImpl)particle.fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL) {
        cmValidator = createAllCM(particle);
    }
    else {
        cmValidator = createDFACM(particle);
    }

    //now we are throught building content model and have passed sucessfully of the nodecount check
    //if set by the application
    fNodeFactory.resetNodeCount() ;

    // if the validator returned is null, it means there is nothing in
    // the content model, so we return the empty content model.
    if (cmValidator == null)
        cmValidator = fEmptyCM;

    return cmValidator;
}
 
Example 18
Source File: XSDAbstractParticleTraverser.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
protected boolean hasAllContent(XSParticleDecl particle) {
    // If the content is not empty, is the top node ALL?
    if (particle != null && particle.fType == XSParticleDecl.PARTICLE_MODELGROUP) {
        return ((XSModelGroupImpl)particle.fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL;
    }

    return false;
}
 
Example 19
Source File: CMBuilder.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
private CMNode buildSyntaxTree(XSParticleDecl particle, boolean optimize) {

        int maxOccurs = particle.fMaxOccurs;
        int minOccurs = particle.fMinOccurs;
        short type = particle.fType;
        CMNode nodeRet = null;

        if ((type == XSParticleDecl.PARTICLE_WILDCARD) ||
            (type == XSParticleDecl.PARTICLE_ELEMENT)) {
            // (task 1) element and wildcard particles should be converted to
            // leaf nodes
            // REVISIT: Make a clone of the leaf particle, so that if there
            // are two references to the same group, we have two different
            // leaf particles for the same element or wildcard decl.
            // This is useful for checking UPA.
            nodeRet = fNodeFactory.getCMLeafNode(particle.fType, particle.fValue, fParticleCount++, fLeafCount++);
            // (task 2) expand occurrence values
            nodeRet = expandContentModel(nodeRet, minOccurs, maxOccurs, optimize);
        }
        else if (type == XSParticleDecl.PARTICLE_MODELGROUP) {
            // (task 1,3) convert model groups to binary trees
            XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
            CMNode temp = null;
            // when the model group is a choice of more than one particles, but
            // only one of the particle is not empty, (for example
            // <choice>
            //   <sequence/>
            //   <element name="e"/>
            // </choice>
            // ) we can't not return that one particle ("e"). instead, we should
            // treat such particle as optional ("e?").
            // the following boolean variable is true when there are at least
            // 2 non-empty children.
            boolean twoChildren = false;
            for (int i = 0; i < group.fParticleCount; i++) {
                // first convert each child to a CM tree
                temp = buildSyntaxTree(group.fParticles[i],
                        optimize &&
                        minOccurs == 1 && maxOccurs == 1 &&
                        (group.fCompositor == XSModelGroupImpl.MODELGROUP_SEQUENCE ||
                         group.fParticleCount == 1));
                // then combine them using binary operation
                if (temp != null) {
                    if (nodeRet == null) {
                        nodeRet = temp;
                    }
                    else {
                        nodeRet = fNodeFactory.getCMBinOpNode(group.fCompositor, nodeRet, temp);
                        // record the fact that there are at least 2 children
                        twoChildren = true;
                    }
                }
            }
            // (task 2) expand occurrence values
            if (nodeRet != null) {
                // when the group is "choice", there is only one non-empty
                // child, and the group had more than one children, we need
                // to create a zero-or-one (optional) node for the non-empty
                // particle.
                if (group.fCompositor == XSModelGroupImpl.MODELGROUP_CHOICE &&
                    !twoChildren && group.fParticleCount > 1) {
                    nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ZERO_OR_ONE, nodeRet);
                }
                nodeRet = expandContentModel(nodeRet, minOccurs, maxOccurs, false);
            }
        }

        return nodeRet;
    }
 
Example 20
Source File: CMBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private CMNode buildSyntaxTree(XSParticleDecl particle, boolean forUPA, boolean optimize) {

        int maxOccurs = particle.fMaxOccurs;
        int minOccurs = particle.fMinOccurs;

        boolean compactedForUPA = false;
        if (forUPA) {
            // When doing UPA, we reduce the size of the minOccurs/maxOccurs values to make
            // processing the DFA faster.  For UPA the exact values don't matter.
            if (minOccurs > 1) {
                if (maxOccurs > minOccurs || particle.getMaxOccursUnbounded()) {
                    minOccurs = 1;
                    compactedForUPA = true;
                }
                else { // maxOccurs == minOccurs
                    minOccurs = 2;
                    compactedForUPA = true;
                }
            }
            if (maxOccurs > 1) {
                maxOccurs = 2;
                compactedForUPA = true;
            }
        }

        short type = particle.fType;
        CMNode nodeRet = null;

        if ((type == XSParticleDecl.PARTICLE_WILDCARD) ||
            (type == XSParticleDecl.PARTICLE_ELEMENT)) {
            // (task 1) element and wildcard particles should be converted to
            // leaf nodes
            // REVISIT: Make a clone of the leaf particle, so that if there
            // are two references to the same group, we have two different
            // leaf particles for the same element or wildcard decl.
            // This is useful for checking UPA.
            nodeRet = fNodeFactory.getCMLeafNode(particle.fType, particle.fValue, fParticleCount++, fLeafCount++);
            // (task 2) expand occurrence values
            nodeRet = expandContentModel(nodeRet, minOccurs, maxOccurs, optimize);
            if (nodeRet != null) {
                nodeRet.setIsCompactUPAModel(compactedForUPA);
            }
        }
        else if (type == XSParticleDecl.PARTICLE_MODELGROUP) {
            // (task 1,3) convert model groups to binary trees
            XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
            CMNode temp = null;
            // when the model group is a choice of more than one particles, but
            // only one of the particle is not empty, (for example
            // <choice>
            //   <sequence/>
            //   <element name="e"/>
            // </choice>
            // ) we can't not return that one particle ("e"). instead, we should
            // treat such particle as optional ("e?").
            // the following boolean variable is true when there are at least
            // 2 non-empty children.
            boolean twoChildren = false;
            for (int i = 0; i < group.fParticleCount; i++) {
                // first convert each child to a CM tree
                temp = buildSyntaxTree(group.fParticles[i],
                        forUPA,
                        optimize &&
                        minOccurs == 1 && maxOccurs == 1 &&
                        (group.fCompositor == XSModelGroupImpl.MODELGROUP_SEQUENCE ||
                         group.fParticleCount == 1));
                // then combine them using binary operation
                if (temp != null) {
                    compactedForUPA |= temp.isCompactedForUPA();
                    if (nodeRet == null) {
                        nodeRet = temp;
                    }
                    else {
                        nodeRet = fNodeFactory.getCMBinOpNode(group.fCompositor, nodeRet, temp);
                        // record the fact that there are at least 2 children
                        twoChildren = true;
                    }
                }
            }
            // (task 2) expand occurrence values
            if (nodeRet != null) {
                // when the group is "choice", there is only one non-empty
                // child, and the group had more than one children, we need
                // to create a zero-or-one (optional) node for the non-empty
                // particle.
                if (group.fCompositor == XSModelGroupImpl.MODELGROUP_CHOICE &&
                    !twoChildren && group.fParticleCount > 1) {
                    nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ZERO_OR_ONE, nodeRet);
                }
                nodeRet = expandContentModel(nodeRet, minOccurs, maxOccurs, false);
                nodeRet.setIsCompactUPAModel(compactedForUPA);
            }
        }

        return nodeRet;
    }