public String toString() { if (fDescription == null) { StringBuffer buffer = new StringBuffer(); buffer.append("OC[mode="); if (fMode == MODE_NONE) { buffer.append("none,"); } else if (fMode == MODE_INTERLEAVE) { buffer.append("interleave,"); } else { buffer.append("suffix,"); } buffer.append(fWildcard.toString()); buffer.append("]"); fDescription = buffer.toString(); } return fDescription; }
/** * check whether this content violates UPA constraint. * * @param subGroupHandler the substitution group handler * @param xsConstraints the XML Schema Constraint checker * @return true if this content model contains other or list wildcard */ public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler, XSConstraints xsConstraints) throws XMLSchemaException { // check whether there is conflict between any two leaves for (int i = 1; i < fNumElements; i++) { for (int j = i+1; j < fNumElements; j++) { if (xsConstraints.overlapUPA(fElements[i], fElements[j], subGroupHandler)) { // REVISIT: do we want to report all errors? or just one? throw new XMLSchemaException("cos-nonambig", new Object[]{fElements[i].toString(), fElements[j].toString()}); } } } for (int i = fNumElements; i < fNumTotal; i++) { for (int j = i+1; j < fNumTotal; j++) { if (xsConstraints.overlapUPA(fWildcards[i], fWildcards[j])) { // REVISIT: do we want to report all errors? or just one? throw new XMLSchemaException("cos-nonambig", new Object[]{fWildcards[i].toString(), fWildcards[j].toString()}); } } } return false; }