本文整理了Java中org.apache.xmlbeans.QNameSet
类的一些代码示例,展示了QNameSet
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QNameSet
类的具体详情如下:
包路径:org.apache.xmlbeans.QNameSet
类名称:QNameSet
[英]This interface represents a lattice of finite and infinite sets of QNames. The lattice the minimal one that is closed under union, intersection, and inverse, and contains individual QNames as well as entire namespaces. Here is a summary of the two kinds of QNameSets:
A QNameSet can cover a finite set of namespaces, additionally including a finite set of QNames outside those namespaces, and with the exception of a finite set of QNames excluded from those namespaes:
excludedQNamesInIncludedURIs == the set of excluded QNames from coveredURIs namespaces
A QNameSet can cover all namespaces except for a finite number of excluded ones, additionally including a finite set of QNames within the excluded namespaces, and with the exception of a finite set of QNames outside the excluded namespaces:
excludedQNamesInIncludedURIs == the set of excluded QNames outside uncoveredURIs namespaces
Notice that a finite set of QNames is a degenerate case of the first category outlined above:
A QnameSet can contain a finite number of QNames:
excludedQNamesInIncludedURIs == empty set
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
public boolean canStartWithElement(QName name)
{ return name != null && _startSet.contains(name); }
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
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);
}
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
/**
* 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);
}
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
/**
* 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());
}
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
return NONLOCAL;
return new QNameSet(
minSetCopy(excludedURIs),
minSetCopy(includedURIs),
minSetCopy(excludedQNamesInIncludedURIs),
minSetCopy(includedQNamesInExcludedURIs));
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
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()));
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
if (!allContents.contains(target))
return QNameSet.EMPTY;
return QNameSet.singleton(target);
if (childContents.contains(target))
builder.addAll(computeNondelimitingElements(target, contentModel.getParticleChild(i), state));
else if (childContents.contains(target))
代码示例来源:origin: org.apache.geronimo.framework/geronimo-deployment
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);
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-corba-builder
public QNameSet getPlanQNameSet() {
return QNameSet.singleton(TSS_LINK_QNAME);
}
代码示例来源:origin: org.apache.geronimo.framework/geronimo-deployment
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);
}
}
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
wcset = QNameSet.ALL;
else
wcset = QNameSet.forWildcardNamespaceString(nslist.getStringValue(), targetNamespace);
sPart.setWildcardSet(wcset);
sPart.setWildcardProcess(translateWildcardProcess(parseAny.xgetProcessContents()));
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
/**
* 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));
}
代码示例来源:origin: org.apache.geronimo.framework/geronimo-deployment
public static void registerSubstitutionGroupElements(QName substitutionGroup, QNameSet substitutions) {
QNameSet oldSubstitutions = substitutionGroups.get(substitutionGroup);
if (oldSubstitutions != null) {
substitutions = oldSubstitutions.union(substitutions);
}
substitutionGroups.put(substitutionGroup, substitutions);
}
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
/**
* 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);
}
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
if (suspectSet.isDisjoint(part.getWildcardSet()))
return;
result.put(part, part.getWildcardSet().intersect(suspectSet));
eliminate.addAll(part.getWildcardSet());
return;
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
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());
}
代码示例来源:origin: com.github.pjfanning/xmlbeans
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()));
代码示例来源:origin: org.apache.xmlbeans/com.springsource.org.apache.xmlbeans
/**
* 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());
}
代码示例来源:origin: com.github.pjfanning/xmlbeans
if (!allContents.contains(target))
return QNameSet.EMPTY;
return QNameSet.singleton(target);
if (childContents.contains(target))
builder.addAll(computeNondelimitingElements(target, contentModel.getParticleChild(i), state));
else if (childContents.contains(target))
代码示例来源:origin: org.apache.geronimo.modules/geronimo-persistence-jpa20-builder
public QNameSet getPlanQNameSet() {
return QNameSet.singleton(PERSISTENCE_QNAME);
}
内容来源于网络,如有侵权,请联系作者删除!