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

public abstract class NameClass
extends Object
implements Serializable

validator of (namespaceURI,localPart) pair. This is equivalent to RELAX NG's "name class".

Author:
Kohsuke KAWAGUCHI
See Also:
Serialized Form

Field Summary
static String LOCALNAME_WILDCARD
           
static String NAMESPACE_WILDCARD
          wildcard should be accepted by any name class.
 
Constructor Summary
NameClass()
           
 
Method Summary
 boolean accepts(StringPair name)
           
abstract  boolean accepts(String namespaceURI, String localName)
          checks if this name class accepts given namespace:localName pair.
abstract  Object visit(NameClassVisitor visitor)
          visitor pattern support
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE_WILDCARD

public static final String NAMESPACE_WILDCARD
wildcard should be accepted by any name class.

LOCALNAME_WILDCARD

public static final String LOCALNAME_WILDCARD
Constructor Detail

NameClass

public NameClass()
Method Detail

accepts

public abstract boolean accepts(String namespaceURI,
                                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)

visit

public abstract Object visit(NameClassVisitor visitor)
visitor pattern support