Package org.apache.xmlbeans
Class QNameSetBuilder
- java.lang.Object
-
- org.apache.xmlbeans.QNameSetBuilder
-
- All Implemented Interfaces:
java.io.Serializable,QNameSetSpecification
public class QNameSetBuilder extends java.lang.Object implements QNameSetSpecification, java.io.Serializable
Used to buildQNameSets.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QNameSetBuilder()Constructs an empty QNameSetBuilder.QNameSetBuilder(java.lang.String str, java.lang.String targetURI)Constructs a QNameSetBuilder whose initial contents are given as a list of namespace URIs, using the same format used by wildcards in XSD files.QNameSetBuilder(java.util.Set excludedURIs, java.util.Set includedURIs, java.util.Set excludedQNamesInIncludedURIs, java.util.Set includedQNamesInExcludedURIs)Constructs a QNameSetBuilder whose inital contents are given by the four sets.QNameSetBuilder(QNameSetSpecification set)Constructs a QNameSetBuilder whose initial contents are given by another QNameSetSpecification.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(javax.xml.namespace.QName qname)Adds a single QName to this QNameSetBuilder.voidaddAll(QNameSetSpecification set)Adds the contents of another QNameSet to this QNameSetBuilder.voidaddNamespace(java.lang.String uri)Adds an entire namespace URI of QNames to this QNameSetBuilder.voidclear()Clears this QNameSetBuilderbooleancontains(javax.xml.namespace.QName name)True if this ModelTransitionSet contains the given qname.booleancontainsAll(QNameSetSpecification set)True if the parameter is a subset of this set.java.util.SetexcludedQNamesInIncludedURIs()The finite set of QNames that are excluded from the set within namespaces that are otherwise included.java.util.SetexcludedURIs()The finite set of namespace URIs that are almost completely excluded from the set (that is, each namespace URI that included in the set with with a finite number of QName exceptions).java.util.SetincludedQNamesInExcludedURIs()The finite set of QNames that are included in the set within namespaces that are otherwise excluded.java.util.SetincludedURIs()The finite set of namespace URIs that are almost completely included in the set (that is, each namespace URI that included in the set with with a finite number of 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.voidinvert()Inverts this QNameSetBuilder.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.voidremove(javax.xml.namespace.QName qname)Removes the given qname from this QNameSetBuilder.voidremoveAll(QNameSetSpecification set)Removes all contents of a given QNameSet from this QNameSetBuilder.voidremoveNamespace(java.lang.String uri)Removes an entire namespace URI from this QNameSetBuilder.voidrestrict(QNameSetSpecification set)Restricts the contents of this QNameSetBuilder to be a subset of the given QNameSet.QNameSettoQNameSet()Returns aQNameSetequivalent to the current state of this QNameSetBuilder.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.
-
-
-
Constructor Detail
-
QNameSetBuilder
public QNameSetBuilder()
Constructs an empty QNameSetBuilder.
-
QNameSetBuilder
public QNameSetBuilder(QNameSetSpecification set)
Constructs a QNameSetBuilder whose initial contents are given by another QNameSetSpecification.- Parameters:
set- the QNameSetSpecificaiton to copy
-
QNameSetBuilder
public QNameSetBuilder(java.util.Set excludedURIs, java.util.Set includedURIs, java.util.Set excludedQNamesInIncludedURIs, java.util.Set includedQNamesInExcludedURIs)Constructs a QNameSetBuilder whose inital contents are given by the four sets. Exactly one of either excludedURIs or includedURIs must be non-null.- 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
-
QNameSetBuilder
public QNameSetBuilder(java.lang.String str, java.lang.String targetURI)Constructs a QNameSetBuilder whose initial contents are given as a list of namespace URIs, using the same format used by wildcards in XSD files.- Parameters:
str- a wildcard namespace specification string such as "##any", "##other", "##local", "##targetNamespace", or a space-separated list of URIs.targetURI- the current targetNamespace
-
-
Method Detail
-
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
-
union
public QNameSet union(QNameSetSpecification set)
Returns a new QNameSet that is the union of this one and another.- Specified by:
unionin interfaceQNameSetSpecification
-
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 parameter is a subset of this set.- Specified by:
containsAllin interfaceQNameSetSpecification
-
isDisjoint
public boolean isDisjoint(QNameSetSpecification set)
True if the given set is disjoint from this one.- Specified by:
isDisjointin interfaceQNameSetSpecification
-
clear
public void clear()
Clears this QNameSetBuilder
-
invert
public void invert()
Inverts this QNameSetBuilder.
-
add
public void add(javax.xml.namespace.QName qname)
Adds a single QName to this QNameSetBuilder.
-
addNamespace
public void addNamespace(java.lang.String uri)
Adds an entire namespace URI of QNames to this QNameSetBuilder. The empty string is used to signifiy the (local) no-namespace.
-
addAll
public void addAll(QNameSetSpecification set)
Adds the contents of another QNameSet to this QNameSetBuilder.
-
remove
public void remove(javax.xml.namespace.QName qname)
Removes the given qname from this QNameSetBuilder.
-
removeNamespace
public void removeNamespace(java.lang.String uri)
Removes an entire namespace URI from this QNameSetBuilder.
-
removeAll
public void removeAll(QNameSetSpecification set)
Removes all contents of a given QNameSet from this QNameSetBuilder.
-
restrict
public void restrict(QNameSetSpecification set)
Restricts the contents of this QNameSetBuilder to be a subset of the given QNameSet. In other words, computes an intersection.
-
excludedURIs
public java.util.Set excludedURIs()
Description copied from interface:QNameSetSpecificationThe finite set of namespace URIs that are almost completely excluded from the set (that is, each namespace URI that included in the set with with a finite number of QName exceptions). Null if the set of namespaceURIs that are almost completely included is infinite.Null (meaning almost all URIs excluded) if includedURIs() is non-null; non-null otherwise.
The same set as inverse().includedURIs().
- Specified by:
excludedURIsin interfaceQNameSetSpecification
-
includedURIs
public java.util.Set includedURIs()
Description copied from interface:QNameSetSpecificationThe finite set of namespace URIs that are almost completely included in the set (that is, each namespace URI that included in the set with with a finite number of QName exceptions). Null if the set of namespaceURIs that are almost completely included is infinite.Null (meaning almost all URIs included) if excludedURIs() is non-null; non-null otherwise.
The same as inverse.excludedURIs().
- Specified by:
includedURIsin interfaceQNameSetSpecification
-
excludedQNamesInIncludedURIs
public java.util.Set excludedQNamesInIncludedURIs()
Description copied from interface:QNameSetSpecificationThe finite set of QNames that are excluded from the set within namespaces that are otherwise included. Should only contain QNames within namespace that are within the set includedURIs() (or any URI, if includedURIs() is null, which means that all URIs are almost completely included).Never null.
The same set as inverse().includedQNames().
- Specified by:
excludedQNamesInIncludedURIsin interfaceQNameSetSpecification
-
includedQNamesInExcludedURIs
public java.util.Set includedQNamesInExcludedURIs()
Description copied from interface:QNameSetSpecificationThe finite set of QNames that are included in the set within namespaces that are otherwise excluded. Should only contain QNames within namespace that are within the set excludedURIs() (or any URI, if excludedURIs() is null, which means that all URIs are almost completely excluded).Never null.
The same as inverse().excludedQNames().
- Specified by:
includedQNamesInExcludedURIsin interfaceQNameSetSpecification
-
toString
public java.lang.String toString()
Returns a string representation useful for debugging, subject to change.- Overrides:
toStringin classjava.lang.Object
-
-