com.sun.msv.grammar.trex

Class TREXGrammar

Implemented Interfaces:
Grammar, Serializable
Known Direct Subclasses:
RELAXNGGrammar

public class TREXGrammar
extends ReferenceExp
implements Grammar

TREX grammar, which is expressed as <grammar> element.

The exp field keeps the start pattern.

Author:
Kohsuke KAWAGUCHI
See Also:
Serialized Form

Nested Class Summary

static class
TREXGrammar.RefContainer

Field Summary

DataTypeVocabularyMap
dataTypes
data type vocabularies used and defined by this grammar.
TREXGrammar.RefContainer
namedPatterns
named patterns which are defined by using <define> element.
ExpressionPool
pool
ExpressionPool that is associated with this grammar

Fields inherited from class com.sun.msv.grammar.ReferenceExp

exp, name

Fields inherited from class com.sun.msv.grammar.Expression

anyString, epsilon, nullSet, verifierTag

Constructor Summary

TREXGrammar()
this constructor can be used for the ununified expressions.
TREXGrammar(ExpressionPool pool)
TREXGrammar(ExpressionPool pool, TREXGrammar parentGrammar)

Method Summary

TREXGrammar
getParentGrammar()
gets a parent TREXGrammar.
ExpressionPool
getPool()
Expression
getTopLevel()
gets the start pattern.

Methods inherited from class com.sun.msv.grammar.ReferenceExp

equals, isDefined, visit, visit, visit, visit

Methods inherited from class com.sun.msv.grammar.Expression

equals, getExpandedExp, hashCode, isEpsilonReducible, peelOccurence, visit, visit, visit, visit, visit, visit, visit, visit

Field Details

dataTypes

public final DataTypeVocabularyMap dataTypes
data type vocabularies used and defined by this grammar.

namedPatterns

public final TREXGrammar.RefContainer namedPatterns
named patterns which are defined by using <define> element. this is a map from pattern name to RefPattern object

pool

public final ExpressionPool pool
ExpressionPool that is associated with this grammar

Constructor Details

TREXGrammar

public TREXGrammar()
this constructor can be used for the ununified expressions. the only reason there are two parameters is to prevent unintentional use of the default constructor.

TREXGrammar

public TREXGrammar(ExpressionPool pool)

TREXGrammar

public TREXGrammar(ExpressionPool pool,
                   TREXGrammar parentGrammar)
Parameters:
parentGrammar - this object is used to resolve <ref> element with parent attribute.

Method Details

getParentGrammar

public final TREXGrammar getParentGrammar()
gets a parent TREXGrammar. In case of nested grammar, the parent grammar will be returned. Otherwise, it returns null.

getPool

public ExpressionPool getPool()
Specified by:
getPool in interface Grammar

getTopLevel

public Expression getTopLevel()
gets the start pattern. The pattern defined under <start> element. This pattern will be used to verify document element.
Specified by:
getTopLevel in interface Grammar