XSCMValidator createAll11CM(XSParticleDecl particle, XSOpenContentDecl openContent) { if (particle.fMaxOccurs == 0) return null; // get the model group, and add all children of it to the content model XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue; // create an all content model. the parameter indicates whether // the <all> itself is optional XS11AllCM allContent = new XS11AllCM(particle.fMinOccurs == 0, group.fParticleCount, group.fParticles, openContent); return allContent; }
XS11AllCM copy() { int[] minOccurs, maxOccurs; if (fNumTotal > 1) { minOccurs = new int[fNumTotal]; maxOccurs = new int[fNumTotal]; System.arraycopy(fMinOccurs, 0, minOccurs, 0, fNumTotal); System.arraycopy(fMaxOccurs, 0, maxOccurs, 0, fNumTotal); } else { minOccurs = null; maxOccurs = null; } return new XS11AllCM(fHasOptionalContent, fElements, fWildcards, minOccurs, maxOccurs, fNumElements, fNumTotal, fOpenContent); } // Collect occurrence information as the derived content model.
private Boolean checkAllEmpty() { // If base (empty) has an open content, turn it into an "all". int[] idx = new int[]{-1}; if (base.nextWildcardTransition(b, bn, idx) != null) { base = new XS11AllCM(false, 0, null, ((XSEmptyCM)base).getOpenContent()); return null; } // Base allows nothing. Derived must be empty too. return Boolean.valueOf(derived.nextElementTransition(d, dn, idx) == null && derived.nextWildcardTransition(d, dn, idx) == null); }