Package com.sun.msv.grammar
Class NameClass
- java.lang.Object
-
- com.sun.msv.grammar.NameClass
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AnyNameClass
,ChoiceNameClass
,DifferenceNameClass
,LaxDefaultNameClass
,LocalNameClass
,NamespaceNameClass
,NotNameClass
,SimpleNameClass
public abstract class NameClass extends java.lang.Object implements java.io.Serializable
validator of (namespaceURI,localPart) pair. This is equivalent to RELAX NG's "name class".- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static NameClass
ALL
name class that accepts everything.static java.lang.String
LOCALNAME_WILDCARD
static java.lang.String
NAMESPACE_WILDCARD
wildcard should be accepted by any name class.static NameClass
NONE
Name class that accepts nothing.private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description NameClass()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
accepts(StringPair name)
abstract boolean
accepts(java.lang.String namespaceURI, java.lang.String localName)
checks if this name class accepts given namespace:localName pair.boolean
includes(NameClass rhs)
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.boolean
isEqualTo(NameClass rhs)
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.NameClass
simplify()
Computes the equivalent but simple name class.static NameClass
union(NameClass lhs, NameClass rhs)
Computes the union of two name classes.abstract java.lang.Object
visit(NameClassVisitor visitor)
visitor pattern support
-
-
-
Field Detail
-
NAMESPACE_WILDCARD
public static final java.lang.String NAMESPACE_WILDCARD
wildcard should be accepted by any name class.- See Also:
- Constant Field Values
-
LOCALNAME_WILDCARD
public static final java.lang.String LOCALNAME_WILDCARD
- See Also:
- Constant Field Values
-
ALL
public static final NameClass ALL
name class that accepts everything.
-
NONE
public static final NameClass NONE
Name class that accepts nothing.
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
accepts
public abstract boolean accepts(java.lang.String namespaceURI, java.lang.String localName)
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
public final boolean accepts(StringPair name)
-
includes
public final boolean includes(NameClass rhs)
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
public final boolean isEqualTo(NameClass rhs)
Returns true if this name class represents the same set as the given name class.
-
simplify
public NameClass simplify()
Computes the equivalent but simple name class.
-
visit
public abstract java.lang.Object visit(NameClassVisitor visitor)
visitor pattern support
-
intersection
public static NameClass intersection(NameClass lhs, NameClass rhs)
Computes the intersection of two name classes.
-
-