private boolean allowedNames(XSWildcardDecl wildcard, XSWildcardDecl superWildcard) { for (int i = 0; i < superWildcard.fDisallowedNamesList.length; i++) { if (wildcard.allowQName(superWildcard.fDisallowedNamesList[i])) { return true; } } return false; }
private QName[] disallowedNamesUnion(XSWildcardDecl one, XSWildcardDecl theOther) { final int len1 = (one.fDisallowedNamesList == null) ? 0 : one.fDisallowedNamesList.length; final int len2 = (theOther.fDisallowedNamesList == null) ? 0 : theOther.fDisallowedNamesList.length; final QName[] result = new QName[len1 + len2]; // simple implementation int count = 0; for (int i=0; i<len1; i++) { if (!theOther.allowQName(one.fDisallowedNamesList[i])) { result[count++] = one.fDisallowedNamesList[i]; } } for (int i=0; i<len2; i++) { if (!one.allowQName(theOther.fDisallowedNamesList[i])) { result[count++] = theOther.fDisallowedNamesList[i]; } } QName[] result2 = new QName[count]; System.arraycopy(result, 0, result2, 0, count); return result2; }
public boolean allowExpandedName(XSWildcardDecl wildcard, QName curElem, SubstitutionGroupHandler subGroupHandler, XSElementDeclHelper eDeclHelper) { if (wildcard.allowQName(curElem)) { if (wildcard.fDisallowedDefined && eDeclHelper.getGlobalElementDecl(curElem) != null) { return false; } return true; } return false; } public List getDefinedNames(SubstitutionGroupHandler subGroupHandler) {
boolean allowAttribute(XSWildcardDecl attrWildcard, QName name, SchemaGrammar grammar) { if (attrWildcard.allowQName(name)) { if (grammar == null || !attrWildcard.fDisallowedDefined) { return true; } return (grammar.getGlobalAttributeDecl(name.localpart) == null); } return false; }
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) { Object matchingDecl = findMatchingElemDecl(elementName, subGroupHandler); if (matchingDecl != null) { return matchingDecl; } for (int i = fNumElements; i < fNumTotal; i++) { if (fWildcards[i].allowQName(elementName)) { return fWildcards[i]; } } return null; }
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) { Object matchingDecl = null; for (int elemIndex = 0; elemIndex < fNumElements; elemIndex++) { matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, fElements[elemIndex], fSchemaVersion); if (matchingDecl != null) { return matchingDecl; } } for (int elemIndex = fNumElements; elemIndex < fNumTotal; elemIndex++) { if (fWildcards[elemIndex].allowQName(curElem)) { return fWildcards[elemIndex]; } } return null; } // findMatchingDecl(QName, SubstitutionGroupHandler): Object
private QName[] disallowedNamesIntersection(XSWildcardDecl one, XSWildcardDecl theOther) { final int len1 = (one.fDisallowedNamesList == null) ? 0 : one.fDisallowedNamesList.length; final int len2 = (theOther.fDisallowedNamesList == null) ? 0 : theOther.fDisallowedNamesList.length; final QName[] result = new QName[len1 + len2]; // simple implementation int count = 0; for (int i=0; i<len1; i++) { final QName qname = one.fDisallowedNamesList[i]; if (theOther.allowQName(qname)) { result[count++] = qname; } // intersection of O1.disallowed names and O2.disallowed names else if (elementInSet(qname, theOther.fDisallowedNamesList)) { result[count++] = qname; } } for (int i=0; i<len2; i++) { if (one.allowQName(theOther.fDisallowedNamesList[i])) { result[count++] = theOther.fDisallowedNamesList[i]; } } QName[] result2 = new QName[count]; System.arraycopy(result, 0, result2, 0, count); return result2; }
public boolean allowExpandedName(XSWildcardDecl wildcard, QName curElem, SubstitutionGroupHandler subGroupHandler, XSElementDeclHelper eDeclHelper) { if (wildcard.allowQName(curElem)) { if (wildcard.fDisallowedSibling && findMatchingElemDecl(curElem, subGroupHandler) != null) { return false; } if (wildcard.fDisallowedDefined && eDeclHelper.getGlobalElementDecl(curElem) != null) { return false; } return true; } return false; }
public boolean allowExpandedName(XSWildcardDecl wildcard, QName curElem, SubstitutionGroupHandler subGroupHandler, XSElementDeclHelper eDeclHelper) { if (wildcard.allowQName(curElem)) { if (wildcard.fDisallowedSibling && findMatchingElemDecl(curElem, subGroupHandler) != null) { return false; } if (wildcard.fDisallowedDefined && eDeclHelper.getGlobalElementDecl(curElem) != null) { return false; } return true; } return false; }