Package org.apache.xmlbeans
Class QNameSetBuilder
java.lang.Object
org.apache.xmlbeans.QNameSetBuilder
- All Implemented Interfaces:
Serializable
,QNameSetSpecification
public class QNameSetBuilder extends Object implements QNameSetSpecification, Serializable
Used to build
QNameSets
.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description QNameSetBuilder()
Constructs an empty QNameSetBuilder.QNameSetBuilder(String str, 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(Set excludedURIs, Set includedURIs, Set excludedQNamesInIncludedURIs, 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
Modifier and Type Method Description void
add(QName qname)
Adds a single QName to this QNameSetBuilder.void
addAll(QNameSetSpecification set)
Adds the contents of another QNameSet to this QNameSetBuilder.void
addNamespace(String uri)
Adds an entire namespace URI of QNames to this QNameSetBuilder.void
clear()
Clears this QNameSetBuilderboolean
contains(QName name)
True if this ModelTransitionSet contains the given qname.boolean
containsAll(QNameSetSpecification set)
True if the parameter is a subset of this set.Set
excludedQNamesInIncludedURIs()
The finite set of QNames that are excluded from the set within namespaces that are otherwise included.Set
excludedURIs()
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).Set
includedQNamesInExcludedURIs()
The finite set of QNames that are included in the set within namespaces that are otherwise excluded.Set
includedURIs()
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).QNameSet
intersect(QNameSetSpecification set)
Returns a new QNameSet that is the intersection of this one and another.QNameSet
inverse()
Returns a new QNameSet that is the inverse of this one.void
invert()
Inverts this QNameSetBuilder.boolean
isAll()
True if this ModelTransitionSet contains all QNames.boolean
isDisjoint(QNameSetSpecification set)
True if the given set is disjoint from this one.boolean
isEmpty()
True if this ModelTransitionSet contains no QNames.void
remove(QName qname)
Removes the given qname from this QNameSetBuilder.void
removeAll(QNameSetSpecification set)
Removes all contents of a given QNameSet from this QNameSetBuilder.void
removeNamespace(String uri)
Removes an entire namespace URI from this QNameSetBuilder.void
restrict(QNameSetSpecification set)
Restricts the contents of this QNameSetBuilder to be a subset of the given QNameSet.QNameSet
toQNameSet()
Returns aQNameSet
equivalent to the current state of this QNameSetBuilder.String
toString()
Returns a string representation useful for debugging, subject to change.QNameSet
union(QNameSetSpecification set)
Returns a new QNameSet that is the union of this one and another.
-
Constructor Details
-
QNameSetBuilder
public QNameSetBuilder()Constructs an empty QNameSetBuilder. -
QNameSetBuilder
Constructs a QNameSetBuilder whose initial contents are given by another QNameSetSpecification.- Parameters:
set
- the QNameSetSpecificaiton to copy
-
QNameSetBuilder
public QNameSetBuilder(Set excludedURIs, Set includedURIs, Set excludedQNamesInIncludedURIs, 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
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 Details
-
contains
True if this ModelTransitionSet contains the given qname.- Specified by:
contains
in interfaceQNameSetSpecification
-
isAll
public boolean isAll()True if this ModelTransitionSet contains all QNames.- Specified by:
isAll
in interfaceQNameSetSpecification
-
isEmpty
public boolean isEmpty()True if this ModelTransitionSet contains no QNames.- Specified by:
isEmpty
in interfaceQNameSetSpecification
-
intersect
Returns a new QNameSet that is the intersection of this one and another.- Specified by:
intersect
in interfaceQNameSetSpecification
-
union
Returns a new QNameSet that is the union of this one and another.- Specified by:
union
in interfaceQNameSetSpecification
-
inverse
Returns a new QNameSet that is the inverse of this one.- Specified by:
inverse
in interfaceQNameSetSpecification
-
containsAll
True if the parameter is a subset of this set.- Specified by:
containsAll
in interfaceQNameSetSpecification
-
isDisjoint
True if the given set is disjoint from this one.- Specified by:
isDisjoint
in interfaceQNameSetSpecification
-
clear
public void clear()Clears this QNameSetBuilder -
invert
public void invert()Inverts this QNameSetBuilder. -
add
Adds a single QName to this QNameSetBuilder. -
addNamespace
Adds an entire namespace URI of QNames to this QNameSetBuilder. The empty string is used to signifiy the (local) no-namespace. -
addAll
Adds the contents of another QNameSet to this QNameSetBuilder. -
remove
Removes the given qname from this QNameSetBuilder. -
removeNamespace
Removes an entire namespace URI from this QNameSetBuilder. -
removeAll
Removes all contents of a given QNameSet from this QNameSetBuilder. -
restrict
Restricts the contents of this QNameSetBuilder to be a subset of the given QNameSet. In other words, computes an intersection. -
excludedURIs
Description copied from interface:QNameSetSpecification
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). 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:
excludedURIs
in interfaceQNameSetSpecification
-
includedURIs
Description copied from interface:QNameSetSpecification
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). 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:
includedURIs
in interfaceQNameSetSpecification
-
excludedQNamesInIncludedURIs
Description copied from interface:QNameSetSpecification
The 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:
excludedQNamesInIncludedURIs
in interfaceQNameSetSpecification
-
includedQNamesInExcludedURIs
Description copied from interface:QNameSetSpecification
The 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:
includedQNamesInExcludedURIs
in interfaceQNameSetSpecification
-
toString
Returns a string representation useful for debugging, subject to change. -
toQNameSet
Returns aQNameSet
equivalent to the current state of this QNameSetBuilder.
-