com.sun.msv.reader.trex

Class TREXBaseReader

public abstract class TREXBaseReader extends GrammarReader

reads TREX grammar from SAX2 and constructs abstract grammar model.

Author: Kohsuke KAWAGUCHI

Nested Class Summary
abstract static classTREXBaseReader.StateFactory
creates various State object, which in turn parses grammar. parsing behavior can be customized by implementing custom StateFactory.
Field Summary
static StringERR_BAD_COMBINE
static StringERR_COMBINE_MISSING
static StringERR_DUPLICATE_DEFINITION
static StringERR_INTERLEAVED_ANYSTRING
static StringERR_INTERLEAVED_STRING
static StringERR_MISSING_CHILD_NAMECLASS
static StringERR_MORE_THAN_ONE_NAMECLASS
static StringERR_NONEXISTENT_PARENT_GRAMMAR
static StringERR_REPEATED_STRING
static StringERR_SEQUENCED_STRING
static StringERR_UNDECLARED_PREFIX
static StringERR_UNDEFINED_PATTERN
static StringERR_UNKNOWN_DATATYPE_VOCABULARY
TREXBaseReader.StateFactorysfactory
static StringWRN_COMBINE_IGNORED
static StringWRN_OBSOLETED_XMLSCHEMA_NAMSPACE
Constructor Summary
TREXBaseReader(GrammarReaderController controller, SAXParserFactory parserFactory, ExpressionPool pool, TREXBaseReader.StateFactory stateFactory, State rootState)
full constructor
Method Summary
StatecreateExpressionChildState(State parent, StartTagInfo tag)
voidendElement(String a, String b, String c)
TREXGrammargetResult()
obtains parsed grammar object only if parsing was successful.
GrammargetResultAsGrammar()
StringgetTargetNamespace()
voidstartElement(String a, String b, String c, Attributes d)
voidwrapUp()
performs final wrap-up.

Field Detail

ERR_BAD_COMBINE

public static final String ERR_BAD_COMBINE

ERR_COMBINE_MISSING

public static final String ERR_COMBINE_MISSING

ERR_DUPLICATE_DEFINITION

public static final String ERR_DUPLICATE_DEFINITION

ERR_INTERLEAVED_ANYSTRING

public static final String ERR_INTERLEAVED_ANYSTRING

ERR_INTERLEAVED_STRING

public static final String ERR_INTERLEAVED_STRING

ERR_MISSING_CHILD_NAMECLASS

public static final String ERR_MISSING_CHILD_NAMECLASS

ERR_MORE_THAN_ONE_NAMECLASS

public static final String ERR_MORE_THAN_ONE_NAMECLASS

ERR_NONEXISTENT_PARENT_GRAMMAR

public static final String ERR_NONEXISTENT_PARENT_GRAMMAR

ERR_REPEATED_STRING

public static final String ERR_REPEATED_STRING

ERR_SEQUENCED_STRING

public static final String ERR_SEQUENCED_STRING

ERR_UNDECLARED_PREFIX

public static final String ERR_UNDECLARED_PREFIX

ERR_UNDEFINED_PATTERN

public static final String ERR_UNDEFINED_PATTERN

ERR_UNKNOWN_DATATYPE_VOCABULARY

public static final String ERR_UNKNOWN_DATATYPE_VOCABULARY

sfactory

public final TREXBaseReader.StateFactory sfactory

WRN_COMBINE_IGNORED

public static final String WRN_COMBINE_IGNORED

WRN_OBSOLETED_XMLSCHEMA_NAMSPACE

public static final String WRN_OBSOLETED_XMLSCHEMA_NAMSPACE

Constructor Detail

TREXBaseReader

public TREXBaseReader(GrammarReaderController controller, SAXParserFactory parserFactory, ExpressionPool pool, TREXBaseReader.StateFactory stateFactory, State rootState)
full constructor

Method Detail

createExpressionChildState

public State createExpressionChildState(State parent, StartTagInfo tag)

endElement

public void endElement(String a, String b, String c)

getResult

public final TREXGrammar getResult()
obtains parsed grammar object only if parsing was successful.

getResultAsGrammar

public Grammar getResultAsGrammar()

getTargetNamespace

public final String getTargetNamespace()

startElement

public void startElement(String a, String b, String c, Attributes d)

wrapUp

public void wrapUp()
performs final wrap-up. This method is called from the RootState object, after the parsing is completed.

This method has to be called after the run-away expression check is done.