Package com.sun.msv.grammar
Class NameClass
java.lang.Object
com.sun.msv.grammar.NameClass
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AnyNameClass
,ChoiceNameClass
,DifferenceNameClass
,LaxDefaultNameClass
,LocalNameClass
,NamespaceNameClass
,NotNameClass
,SimpleNameClass
validator of (namespaceURI,localPart) pair.
This is equivalent to RELAX NG's "name class".
- Author:
- Kohsuke KAWAGUCHI
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
accepts
(StringPair name) abstract boolean
checks if this name class accepts given namespace:localName pair.final boolean
Returns true if this name class is a superset of another name class.static NameClass
intersection
(NameClass lhs, NameClass rhs) Computes the intersection of two name classes.final boolean
Returns true if this name class represents the same set as the given name class.boolean
isNull()
Returns true if this name class doesn't accept anything.simplify()
Computes the equivalent but simple name class.static NameClass
Computes the union of two name classes.abstract Object
visit
(NameClassVisitor visitor) visitor pattern support
-
Field Details
-
NAMESPACE_WILDCARD
wildcard should be accepted by any name class.- See Also:
-
LOCALNAME_WILDCARD
- See Also:
-
ALL
name class that accepts everything. -
NONE
Name class that accepts nothing.
-
-
Constructor Details
-
NameClass
public NameClass()
-
-
Method Details
-
accepts
checks if this name class accepts given namespace:localName pair.- Parameters:
namespaceURI
- namespace URI to be tested. If this value equals to NAMESPACE_WILDCARD, implementation must assume that valid namespace is specified. this twist will be used for error diagnosis.localName
- local part to be tested. As with namespaceURI, LOCALNAME_WILDCARD will acts as a wild card.- Returns:
- true if the pair is accepted, false otherwise.
-
accepts
-
includes
Returns true if this name class is a superset of another name class. -
isNull
public boolean isNull()Returns true if this name class doesn't accept anything. -
isEqualTo
Returns true if this name class represents the same set as the given name class. -
simplify
Computes the equivalent but simple name class. -
visit
visitor pattern support -
intersection
Computes the intersection of two name classes. -
union
Computes the union of two name classes.
-