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 void
add(javax.xml.namespace.QName qname)
Adds a single QName to this QNameSetBuilder.void
addAll(QNameSetSpecification set)
Adds the contents of another QNameSet to this QNameSetBuilder.void
addNamespace(java.lang.String uri)
Adds an entire namespace URI of QNames to this QNameSetBuilder.void
clear()
Clears this QNameSetBuilderboolean
contains(javax.xml.namespace.QName name)
True if this ModelTransitionSet contains the given qname.boolean
containsAll(QNameSetSpecification set)
True if the parameter is a subset of this set.java.util.Set
excludedQNamesInIncludedURIs()
The finite set of QNames that are excluded from the set within namespaces that are otherwise included.java.util.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).java.util.Set
includedQNamesInExcludedURIs()
The finite set of QNames that are included in the set within namespaces that are otherwise excluded.java.util.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(javax.xml.namespace.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(java.lang.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.java.lang.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 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:
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
public QNameSet intersect(QNameSetSpecification set)
Returns a new QNameSet that is the intersection of this one and another.- Specified by:
intersect
in interfaceQNameSetSpecification
-
union
public QNameSet union(QNameSetSpecification set)
Returns a new QNameSet that is the union of this one and another.- Specified by:
union
in interfaceQNameSetSpecification
-
inverse
public QNameSet inverse()
Returns a new QNameSet that is the inverse of this one.- Specified by:
inverse
in interfaceQNameSetSpecification
-
containsAll
public boolean containsAll(QNameSetSpecification set)
True if the parameter is a subset of this set.- Specified by:
containsAll
in interfaceQNameSetSpecification
-
isDisjoint
public boolean isDisjoint(QNameSetSpecification set)
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
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: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
public java.util.Set 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
public java.util.Set 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
public java.util.Set 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
public java.lang.String toString()
Returns a string representation useful for debugging, subject to change.- Overrides:
toString
in classjava.lang.Object
-
-