public boolean canStartWithElement(QName name) { return name != null && _startSet.contains(name); }
QNameSet readQNameSet() { int flag = readShort(); Set uriSet = new HashSet(); int uriCount = readShort(); for (int i = 0; i < uriCount; i++) uriSet.add(readString()); Set qnameSet1 = new HashSet(); int qncount1 = readShort(); for (int i = 0; i < qncount1; i++) qnameSet1.add(readQName()); Set qnameSet2 = new HashSet(); int qncount2 = readShort(); for (int i = 0; i < qncount2; i++) qnameSet2.add(readQName()); if (flag == 1) return QNameSet.forSets(uriSet, null, qnameSet1, qnameSet2); else return QNameSet.forSets(null, uriSet, qnameSet2, qnameSet1); }
/** * True if the given set is a subset of this one. * @param set the set to test * @return true if this contains all QNames contained by the given set */ public boolean containsAll(QNameSetSpecification set) { // a.contains(b) == a.inverse.isDisjoint(b) if (!_inverted && set.excludedURIs() != null) return false; return inverse().isDisjoint(set); }
/** * Returns a new QNameSet that is the inverse of this one. */ public QNameSet inverse() { if (this == EMPTY) return ALL; if (this == ALL) return EMPTY; if (this == LOCAL) return NONLOCAL; if (this == NONLOCAL) return LOCAL; return new QNameSet(includedURIs(), excludedURIs(), includedQNamesInExcludedURIs(), excludedQNamesInIncludedURIs()); }
return NONLOCAL; return new QNameSet( minSetCopy(excludedURIs), minSetCopy(includedURIs), minSetCopy(excludedQNamesInIncludedURIs), minSetCopy(includedQNamesInExcludedURIs));
if (!baseModel.getWildcardSet().contains(sAttr.getName())) state.error(XmlErrorCodes.COMPLEX_TYPE_RESTRICTION$ATTR_IN_BASE_WILDCARD_SET, new Object[] { QNameHelper.pretty(sAttr.getName()), QNameHelper.pretty(outerType.getName()) }, xsdattr); else nsText = nsList.getStringValue(); QNameSet wcset = QNameSet.forWildcardNamespaceString(nsText, targetNamespace); continue; // ignore the extra wildcard else if (!baseModel.getWildcardSet().containsAll(wcset)) result.setWildcardSet(wcset.union(result.getWildcardSet())); result.setWildcardProcess(wcprocess); result.setWildcardSet(wcset.intersect(result.getWildcardSet()));
protected void addBuilder(T builder) { QNameSet builderSpecQNames = builder.getSpecQNameSet(); QNameSet builderPlanQNames = builder.getPlanQNameSet(); if (builderSpecQNames == null) { throw new IllegalStateException("Builder " + builder + " is missing spec qnames"); } if (builderPlanQNames == null) { throw new IllegalStateException("Builder " + builder + " is missing plan qnames"); } if (!specQNames.isDisjoint(builderSpecQNames) && !planQNames.isDisjoint(builderPlanQNames)) { throw new IllegalArgumentException("Duplicate builderSpecQNames in builder set: " + builderSpecQNames + " and duplicate builderPlanQNames in builder set: " + builderPlanQNames); } try { specQNames = specQNames.union(builderSpecQNames); planQNames = planQNames.union(builderPlanQNames); } catch (NullPointerException e) { throw (IllegalArgumentException) new IllegalArgumentException("could not merge qnamesets for builder " + builder).initCause(e); } //really? XmlBeansUtil.registerSubstitutionGroupElements(builder.getBaseQName(), builderPlanQNames); }
public QNameSet getPlanQNameSet() { return QNameSet.singleton(TSS_LINK_QNAME); }
public static void unregisterSubstitutionGroupElements(QName substitutionGroup, QNameSet substitutions) { QNameSet oldSubstitutions = substitutionGroups.get(substitutionGroup); if (oldSubstitutions != null && substitutions != null) { QNameSet difference = oldSubstitutions.intersect(substitutions.inverse()); substitutionGroups.put(substitutionGroup, difference); } }
wcset = QNameSet.ALL; else wcset = QNameSet.forWildcardNamespaceString(nslist.getStringValue(), targetNamespace); sPart.setWildcardSet(wcset); sPart.setWildcardProcess(translateWildcardProcess(parseAny.xgetProcessContents()));
/** * Returns a QNameSet containing only the given QName. * @return the constructed QNameSet */ public static QNameSet singleton(QName name) { return new QNameSet(null, Collections.EMPTY_SET, Collections.EMPTY_SET, Collections.singleton(name)); }
public static void registerSubstitutionGroupElements(QName substitutionGroup, QNameSet substitutions) { QNameSet oldSubstitutions = substitutionGroups.get(substitutionGroup); if (oldSubstitutions != null) { substitutions = oldSubstitutions.union(substitutions); } substitutionGroups.put(substitutionGroup, substitutions); }
/** * True if the parameter is a subset of this set. */ public boolean containsAll(QNameSetSpecification set) { if (!_inverted && set.excludedURIs() != null) return false; return inverse().isDisjoint(set); }
if (suspectSet.isDisjoint(part.getWildcardSet())) return; result.put(part, part.getWildcardSet().intersect(suspectSet)); eliminate.addAll(part.getWildcardSet()); return;
private static boolean afterMapSubsumedByStartMap(Map startMap, Map afterMap) { if (afterMap.size() > startMap.size()) return false; if (afterMap.isEmpty()) return true; for (Iterator i = startMap.keySet().iterator(); i.hasNext(); ) { SchemaParticle part = (SchemaParticle)i.next(); if (part.getParticleType() == SchemaParticle.WILDCARD) { if (afterMap.containsKey(part)) { QNameSet startSet = (QNameSet)startMap.get(part); QNameSet afterSet = (QNameSet)afterMap.get(part); if (!startSet.containsAll(afterSet)) return false; } } afterMap.remove(part); if (afterMap.isEmpty()) return true; } return (afterMap.isEmpty()); }
if (!baseModel.getWildcardSet().contains(sAttr.getName())) state.error(XmlErrorCodes.COMPLEX_TYPE_RESTRICTION$ATTR_IN_BASE_WILDCARD_SET, new Object[] { QNameHelper.pretty(sAttr.getName()), QNameHelper.pretty(outerType.getName()) }, xsdattr); else nsText = nsList.getStringValue(); QNameSet wcset = QNameSet.forWildcardNamespaceString(nsText, targetNamespace); continue; // ignore the extra wildcard else if (!baseModel.getWildcardSet().containsAll(wcset)) result.setWildcardSet(wcset.union(result.getWildcardSet())); result.setWildcardProcess(wcprocess); result.setWildcardSet(wcset.intersect(result.getWildcardSet()));
/** * Returns a new QNameSet that is the inverse of this one. */ public QNameSet inverse() { if (this == EMPTY) return ALL; if (this == ALL) return EMPTY; if (this == LOCAL) return NONLOCAL; if (this == NONLOCAL) return LOCAL; return new QNameSet(includedURIs(), excludedURIs(), includedQNamesInExcludedURIs(), excludedQNamesInIncludedURIs()); }
public QNameSet getPlanQNameSet() { return QNameSet.singleton(PERSISTENCE_QNAME); }