Package org.apache.xmlbeans
Class QNameSet
- java.lang.Object
-
- org.apache.xmlbeans.QNameSet
-
- All Implemented Interfaces:
java.io.Serializable,QNameSetSpecification
public final class QNameSet extends java.lang.Object implements QNameSetSpecification, java.io.Serializable
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
- excludedURIs == null
- includedURIs == the set of covered namespace URIs
- includedQNamesInExcludedURIs == set of additional QNames outside 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
- excludedURIs == the set of uncovered namespace URIs
- includedURIs == null
- includedQNamesInExcludedURIs == set of additional QNames from 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
- excludedURIs == null
- includedURIs == empty set
- includedQNamesInExcludedURIs == set of included QNames
- See Also:
QNameSetBuilder, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static QNameSetALLThe QNameSet containing all QNames.static QNameSetEMPTYThe empty QNameSet.static QNameSetLOCALThe QNameSet containing all QNames in the local (no-)namespace.static QNameSetNONLOCALThe QNameSet containing all QNames except for those in the local (no-)namespace.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(javax.xml.namespace.QName name)True if this ModelTransitionSet contains the given qname.booleancontainsAll(QNameSetSpecification set)True if the given set is a subset of this one.java.util.SetexcludedQNamesInIncludedURIs()The set of QNames excluded from the set even though they are within a namespace that is otherwise fully included in the set.java.util.SetexcludedURIs()Namespaces that are fully excluded from the set except for a finite number of individual QName exceptions.static QNameSetforArray(javax.xml.namespace.QName[] includedQNames)Returns a QNameSet based on the given array of included QNamesstatic QNameSetforSets(java.util.Set excludedURIs, java.util.Set includedURIs, java.util.Set excludedQNamesInIncludedURIs, java.util.Set includedQNamesInExcludedURIs)Returns a QNameSet based on the given sets of excluded URIs, included URIs, excluded QNames in included namespaces, and included QNames in excluded namespaces.static QNameSetforSpecification(QNameSetSpecification spec)Returns a QNameSet with the same contents as the given QNameSetSpecification.static QNameSetforWildcardNamespaceString(java.lang.String wildcard, java.lang.String targetURI)Returns a QNameSet corresponding to the given wildcard namespace string.java.util.SetincludedQNamesInExcludedURIs()The set of QNames included in the set even though they are within a namespace that is otherwise fully included in the set.java.util.SetincludedURIs()Namespaces that are fully included in set except for a finite number of individual QName exceptions.QNameSetintersect(QNameSetSpecification set)Returns a new QNameSet that is the intersection of this one and another.QNameSetinverse()Returns a new QNameSet that is the inverse of this one.booleanisAll()True if this ModelTransitionSet contains all QNames.booleanisDisjoint(QNameSetSpecification set)True if the given set is disjoint from this one.booleanisEmpty()True if this ModelTransitionSet contains no QNames.static QNameSetsingleton(javax.xml.namespace.QName name)Returns a QNameSet containing only the given QName.java.lang.StringtoString()Returns a string representation useful for debugging, subject to change.QNameSetunion(QNameSetSpecification set)Returns a new QNameSet that is the union of this one and another.
-
-
-
Field Detail
-
EMPTY
public static final QNameSet EMPTY
The empty QNameSet.
-
ALL
public static final QNameSet ALL
The QNameSet containing all QNames.
-
LOCAL
public static final QNameSet LOCAL
The QNameSet containing all QNames in the local (no-)namespace.
-
NONLOCAL
public static final QNameSet NONLOCAL
The QNameSet containing all QNames except for those in the local (no-)namespace.
-
-
Method Detail
-
forSets
public static QNameSet forSets(java.util.Set excludedURIs, java.util.Set includedURIs, java.util.Set excludedQNamesInIncludedURIs, java.util.Set includedQNamesInExcludedURIs)
Returns a QNameSet based on the given sets of excluded URIs, included URIs, excluded QNames in included namespaces, and included QNames in excluded namespaces.- Parameters:
excludedURIs- the finite set of namespace URI strings to exclude from the set, or null if this set is infiniteincludedURIs- the finite set of namespace URI strings to include in the set, or null if this set is infiniteexcludedQNamesInIncludedURIs- the finite set of exceptional QNames to exclude from the included namespacesexcludedQNamesInIncludedURIs- the finite set of exceptional QNames to include that are in the excluded namespaces- Returns:
- the constructed QNameSet
-
forArray
public static QNameSet forArray(javax.xml.namespace.QName[] includedQNames)
Returns a QNameSet based on the given array of included QNames- Parameters:
includedQNames- the array of included QNames
-
forSpecification
public static QNameSet forSpecification(QNameSetSpecification spec)
Returns a QNameSet with the same contents as the given QNameSetSpecification.- Returns:
- the copied QNameSet
-
forWildcardNamespaceString
public static QNameSet forWildcardNamespaceString(java.lang.String wildcard, java.lang.String targetURI)
Returns a QNameSet corresponding to the given wildcard namespace string. This is a space-separated list of URIs, plus special tokens as specified in the XML Schema specification (##any, ##other, ##targetNamespace, ##local).- Returns:
- the constructed QNameSet
-
singleton
public static QNameSet singleton(javax.xml.namespace.QName name)
Returns a QNameSet containing only the given QName.- Returns:
- the constructed QNameSet
-
contains
public boolean contains(javax.xml.namespace.QName name)
True if this ModelTransitionSet contains the given qname.- Specified by:
containsin interfaceQNameSetSpecification
-
isAll
public boolean isAll()
True if this ModelTransitionSet contains all QNames.- Specified by:
isAllin interfaceQNameSetSpecification
-
isEmpty
public boolean isEmpty()
True if this ModelTransitionSet contains no QNames.- Specified by:
isEmptyin interfaceQNameSetSpecification
-
intersect
public QNameSet intersect(QNameSetSpecification set)
Returns a new QNameSet that is the intersection of this one and another.- Specified by:
intersectin interfaceQNameSetSpecification- Parameters:
set- the set to insersect with- Returns:
- the intersection
-
union
public QNameSet union(QNameSetSpecification set)
Returns a new QNameSet that is the union of this one and another.- Specified by:
unionin interfaceQNameSetSpecification- Parameters:
set- the set to union with- Returns:
- the union
-
inverse
public QNameSet inverse()
Returns a new QNameSet that is the inverse of this one.- Specified by:
inversein interfaceQNameSetSpecification
-
containsAll
public boolean containsAll(QNameSetSpecification set)
True if the given set is a subset of this one.- Specified by:
containsAllin interfaceQNameSetSpecification- Parameters:
set- the set to test- Returns:
- true if this contains all QNames contained by the given set
-
isDisjoint
public boolean isDisjoint(QNameSetSpecification set)
True if the given set is disjoint from this one.- Specified by:
isDisjointin interfaceQNameSetSpecification- Parameters:
set- the set to test- Returns:
- true if the set is disjoint from this set
-
excludedURIs
public java.util.Set excludedURIs()
Namespaces that are fully excluded from the set except for a finite number of individual QName exceptions. Returns null if this set is infinite.- Specified by:
excludedURIsin interfaceQNameSetSpecification- Returns:
- the set of excluded namespace URI strings
-
includedURIs
public java.util.Set includedURIs()
Namespaces that are fully included in set except for a finite number of individual QName exceptions. Returns null if this set is infinite.- Specified by:
includedURIsin interfaceQNameSetSpecification- Returns:
- the set of included namespace URI strings
-
excludedQNamesInIncludedURIs
public java.util.Set excludedQNamesInIncludedURIs()
The set of QNames excluded from the set even though they are within a namespace that is otherwise fully included in the set.- Specified by:
excludedQNamesInIncludedURIsin interfaceQNameSetSpecification- Returns:
- the set of excluded QNames from within includedURI namespaces
-
includedQNamesInExcludedURIs
public java.util.Set includedQNamesInExcludedURIs()
The set of QNames included in the set even though they are within a namespace that is otherwise fully included in the set.- Specified by:
includedQNamesInExcludedURIsin interfaceQNameSetSpecification- Returns:
- the set of included QNames from within excludedURI namespaces
-
toString
public java.lang.String toString()
Returns a string representation useful for debugging, subject to change.- Overrides:
toStringin classjava.lang.Object
-
-