Class LaxDefaultNameClass
- All Implemented Interfaces:
Serializable
In "lax" mode, we need a name class that matches all undefined names. Although it is possible to use DifferenceNameClass for this purpose, it is not a cost-efficient way because typically it becomes very large. (If there are twenty element declarations, we'll need twenty DifferenceNameClass to exclude all defined names).
This name class uses a Set
to hold multiple names. If a name
is contained in that set, it'll be rejected. If a name is not contained,
it'll be accepted.
Special care is taken to make this NC as seamless as possible. When the visit method is called, the equivalent name class is constructed internally and the visitor will visit that name class. In this way, the visitors won't notice the existance of this "special" name class.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate NameClass
protected NameClass
equivalent name class by conventional primitives.private final Set
set ofStringPair
s.private static final long
Fields inherited from class com.sun.msv.grammar.NameClass
ALL, LOCALNAME_WILDCARD, NAMESPACE_WILDCARD, NONE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checks if this name class accepts given namespace:localName pair.void
add a name so that this name will be rejected by the accepts method.visit
(NameClassVisitor visitor) visitor pattern support
-
Field Details
-
base
-
equivalentNameClass
equivalent name class by conventional primitives. Initially null, and created on demand. -
names
set ofStringPair
s. each item represents one name. it also contains WILDCARD as entry. -
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
LaxDefaultNameClass
- Parameters:
_base
- this name class accepts a name if- it's in the 'base" name class and
- it's not one of those excluded names
-
-
Method Details
-
visit
Description copied from class:NameClass
visitor pattern support -
accepts
Description copied from class:NameClass
checks if this name class accepts given namespace:localName pair.- Specified by:
accepts
in classNameClass
- 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.
-
addName
add a name so that this name will be rejected by the accepts method.
-