本文整理汇总了Java中com.sun.org.apache.xerces.internal.impl.xs.XSModelGroupImpl.MODELGROUP_SEQUENCE属性的典型用法代码示例。如果您正苦于以下问题:Java XSModelGroupImpl.MODELGROUP_SEQUENCE属性的具体用法?Java XSModelGroupImpl.MODELGROUP_SEQUENCE怎么用?Java XSModelGroupImpl.MODELGROUP_SEQUENCE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.org.apache.xerces.internal.impl.xs.XSModelGroupImpl
的用法示例。
在下文中一共展示了XSModelGroupImpl.MODELGROUP_SEQUENCE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getErrorContent
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;
}
示例2: calcFirstPos
protected void calcFirstPos(CMStateSet toSet) {
if (type() == XSModelGroupImpl.MODELGROUP_CHOICE) {
// Its the the union of the first positions of our children.
toSet.setTo(fLeftChild.firstPos());
toSet.union(fRightChild.firstPos());
}
else if (type() == XSModelGroupImpl.MODELGROUP_SEQUENCE) {
//
// If our left child is nullable, then its the union of our
// children's first positions. Else is our left child's first
// positions.
//
toSet.setTo(fLeftChild.firstPos());
if (fLeftChild.isNullable())
toSet.union(fRightChild.firstPos());
}
else {
throw new RuntimeException("ImplementationMessages.VAL_BST");
}
}
示例3: calcLastPos
protected void calcLastPos(CMStateSet toSet) {
if (type() == XSModelGroupImpl.MODELGROUP_CHOICE) {
// Its the the union of the first positions of our children.
toSet.setTo(fLeftChild.lastPos());
toSet.union(fRightChild.lastPos());
}
else if (type() == XSModelGroupImpl.MODELGROUP_SEQUENCE) {
//
// If our right child is nullable, then its the union of our
// children's last positions. Else is our right child's last
// positions.
//
toSet.setTo(fRightChild.lastPos());
if (fRightChild.isNullable())
toSet.union(fLeftChild.lastPos());
}
else {
throw new RuntimeException("ImplementationMessages.VAL_BST");
}
}
示例4: copyNode
private CMNode copyNode(CMNode node) {
int type = node.type();
// for choice or sequence, copy the two subtrees, and combine them
if (type == XSModelGroupImpl.MODELGROUP_CHOICE ||
type == XSModelGroupImpl.MODELGROUP_SEQUENCE) {
XSCMBinOp bin = (XSCMBinOp)node;
node = fNodeFactory.getCMBinOpNode(type, copyNode(bin.getLeft()),
copyNode(bin.getRight()));
}
// for ?+*, copy the subtree, and put it in a new ?+* node
else if (type == XSParticleDecl.PARTICLE_ZERO_OR_MORE ||
type == XSParticleDecl.PARTICLE_ONE_OR_MORE ||
type == XSParticleDecl.PARTICLE_ZERO_OR_ONE) {
XSCMUniOp uni = (XSCMUniOp)node;
node = fNodeFactory.getCMUniOpNode(type, copyNode(uni.getChild()));
}
// for element/wildcard (leaf), make a new leaf node,
// with a distinct position
else if (type == XSParticleDecl.PARTICLE_ELEMENT ||
type == XSParticleDecl.PARTICLE_WILDCARD) {
XSCMLeaf leaf = (XSCMLeaf)node;
node = fNodeFactory.getCMLeafNode(leaf.type(), leaf.getLeaf(), leaf.getParticleId(), fLeafCount++);
}
return node;
}
示例5: XSCMBinOp
public XSCMBinOp(int type, CMNode leftNode, CMNode rightNode)
{
super(type);
// Insure that its one of the types we require
if ((type() != XSModelGroupImpl.MODELGROUP_CHOICE)
&& (type() != XSModelGroupImpl.MODELGROUP_SEQUENCE)) {
throw new RuntimeException("ImplementationMessages.VAL_BST");
}
// Store the nodes and init any data that needs it
fLeftChild = leftNode;
fRightChild = rightNode;
}
示例6: isNullable
public boolean isNullable() {
//
// If its an alternation, then if either child is nullable then
// this node is nullable. If its a concatenation, then both of
// them have to be nullable.
//
if (type() == XSModelGroupImpl.MODELGROUP_CHOICE)
return (fLeftChild.isNullable() || fRightChild.isNullable());
else if (type() == XSModelGroupImpl.MODELGROUP_SEQUENCE)
return (fLeftChild.isNullable() && fRightChild.isNullable());
else
throw new RuntimeException("ImplementationMessages.VAL_BST");
}
示例7: postTreeBuildInit
/** Post tree build initialization. */
private void postTreeBuildInit(CMNode nodeCur) throws RuntimeException {
// Set the maximum states on this node
nodeCur.setMaxStates(fLeafCount);
XSCMLeaf leaf = null;
int pos = 0;
// Recurse as required
if (nodeCur.type() == XSParticleDecl.PARTICLE_WILDCARD) {
leaf = (XSCMLeaf)nodeCur;
pos = leaf.getPosition();
fLeafList[pos] = leaf;
fLeafListType[pos] = XSParticleDecl.PARTICLE_WILDCARD;
}
else if ((nodeCur.type() == XSModelGroupImpl.MODELGROUP_CHOICE) ||
(nodeCur.type() == XSModelGroupImpl.MODELGROUP_SEQUENCE)) {
postTreeBuildInit(((XSCMBinOp)nodeCur).getLeft());
postTreeBuildInit(((XSCMBinOp)nodeCur).getRight());
}
else if (nodeCur.type() == XSParticleDecl.PARTICLE_ZERO_OR_MORE ||
nodeCur.type() == XSParticleDecl.PARTICLE_ONE_OR_MORE ||
nodeCur.type() == XSParticleDecl.PARTICLE_ZERO_OR_ONE) {
postTreeBuildInit(((XSCMUniOp)nodeCur).getChild());
}
else if (nodeCur.type() == XSParticleDecl.PARTICLE_ELEMENT) {
// Put this node in the leaf list at the current index if its
// a non-epsilon leaf.
leaf = (XSCMLeaf)nodeCur;
pos = leaf.getPosition();
fLeafList[pos] = leaf;
fLeafListType[pos] = XSParticleDecl.PARTICLE_ELEMENT;
}
else {
throw new RuntimeException("ImplementationMessages.VAL_NIICM");
}
}