Top Description Fields Constructors Methods
com.sun.msv.grammar

public abstract Class NameClass

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
com.sun.msv.grammar.NamespaceNameClass, com.sun.msv.grammar.NotNameClass, com.sun.msv.grammar.SimpleNameClass, com.sun.msv.grammar.dtd.LocalNameClass, com.sun.msv.grammar.xmlschema.LaxDefaultNameClass, com.sun.msv.grammar.AnyNameClass, com.sun.msv.grammar.ChoiceNameClass, com.sun.msv.grammar.DifferenceNameClass
Imports
com.sun.msv.grammar.util.NameClassCollisionChecker, .NameClassComparator, .NameClassSimplifier, com.sun.msv.util.StringPair

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

Field Summary

Modifier and TypeField and Description
public static final NameClass
ALL

name class that accepts everything.

public static final String
public static final String
NAMESPACE_WILDCARD

wildcard should be accepted by any name class.

public static final NameClass
NONE

Name class that accepts nothing.

private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract boolean

Returns:

true if the pair is accepted, false otherwise.
accepts
(String
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.
namespaceURI
,
String
local part to be tested. As with namespaceURI, LOCALNAME_WILDCARD will acts as a wild card.
localName
)

checks if this name class accepts given namespace:localName pair.

public final boolean
public final boolean
includes(NameClass rhs)

Returns true if this name class is a superset of another name class.

public static NameClass
intersection(NameClass lhs, NameClass rhs)

Computes the intersection of two name classes.

public final boolean
isEqualTo(NameClass rhs)

Returns true if this name class represents the same set as the given name class.

public boolean
isNull()

Returns true if this name class doesn't accept anything.

public NameClass
simplify()

Computes the equivalent but simple name class.

public static NameClass
union(NameClass lhs, NameClass rhs)

Computes the union of two name classes.

public abstract Object
visit(NameClassVisitor visitor)

visitor pattern support

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALLback to summary
public static final NameClass ALL

name class that accepts everything.

LOCALNAME_WILDCARDback to summary
public static final String LOCALNAME_WILDCARD
NAMESPACE_WILDCARDback to summary
public static final String NAMESPACE_WILDCARD

wildcard should be accepted by any name class.

NONEback to summary
public static final NameClass NONE

Name class that accepts nothing.

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

NameClassback to summary
public NameClass()

Method Detail

acceptsback to summary
public abstract boolean accepts(String namespaceURI, String localName)

checks if this name class accepts given namespace:localName pair.

Parameters
namespaceURI:String

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:String

local part to be tested. As with namespaceURI, LOCALNAME_WILDCARD will acts as a wild card.

Returns:boolean

true if the pair is accepted, false otherwise.

acceptsback to summary
public final boolean accepts(StringPair name)
includesback to summary
public final boolean includes(NameClass rhs)

Returns true if this name class is a superset of another name class.

intersectionback to summary
public static NameClass intersection(NameClass lhs, NameClass rhs)

Computes the intersection of two name classes.

isEqualToback to summary
public final boolean isEqualTo(NameClass rhs)

Returns true if this name class represents the same set as the given name class.

isNullback to summary
public boolean isNull()

Returns true if this name class doesn't accept anything.

simplifyback to summary
public NameClass simplify()

Computes the equivalent but simple name class.

unionback to summary
public static NameClass union(NameClass lhs, NameClass rhs)

Computes the union of two name classes.

visitback to summary
public abstract Object visit(NameClassVisitor visitor)

visitor pattern support