com.sun.msv.reader.trex.ng.comp

Class RELAXNGCompReader

public class RELAXNGCompReader extends RELAXNGReader

reads RELAX NG grammar with DTD compatibility annotation and constructs abstract grammar model.

Author: Kohsuke KAWAGUCHI

Nested Class Summary
static classRELAXNGCompReader.StateFactory
creates various State object, which in turn parses grammar. parsing behavior can be customized by implementing custom StateFactory.
Field Summary
static StringAnnotationNamespace
Namespace URI of RELAX NG DTD compatibility annotation
static StringCERR_ANN_CHILD_ELEMENT
static StringCERR_ANN_INVALID_ATTRIBUTE
static StringCERR_ANN_MISPLACED
Constructor Summary
RELAXNGCompReader(GrammarReaderController controller)
easy-to-use constructor.
RELAXNGCompReader(GrammarReaderController controller, SAXParserFactory parserFactory, ExpressionPool pool)
easy-to-use constructor.
RELAXNGCompReader(GrammarReaderController controller, SAXParserFactory parserFactory, RELAXNGCompReader.StateFactory stateFactory, ExpressionPool pool)
full constructor
Method Summary
voidendElement(String uri, String local, String qname)
static TREXGrammarparse(String grammarURL, GrammarReaderController controller)
loads RELAX NG pattern.
static TREXGrammarparse(InputSource grammar, GrammarReaderController controller)
loads RELAX NG pattern.
voidstartElement(String uri, String local, String qname, Attributes atts)
voidwrapUp()

Field Detail

AnnotationNamespace

public static final String AnnotationNamespace
Namespace URI of RELAX NG DTD compatibility annotation

CERR_ANN_CHILD_ELEMENT

public static final String CERR_ANN_CHILD_ELEMENT

CERR_ANN_INVALID_ATTRIBUTE

public static final String CERR_ANN_INVALID_ATTRIBUTE

CERR_ANN_MISPLACED

public static final String CERR_ANN_MISPLACED

Constructor Detail

RELAXNGCompReader

public RELAXNGCompReader(GrammarReaderController controller)
easy-to-use constructor.

RELAXNGCompReader

public RELAXNGCompReader(GrammarReaderController controller, SAXParserFactory parserFactory, ExpressionPool pool)
easy-to-use constructor.

RELAXNGCompReader

public RELAXNGCompReader(GrammarReaderController controller, SAXParserFactory parserFactory, RELAXNGCompReader.StateFactory stateFactory, ExpressionPool pool)
full constructor

Method Detail

endElement

public void endElement(String uri, String local, String qname)

parse

public static TREXGrammar parse(String grammarURL, GrammarReaderController controller)
loads RELAX NG pattern.

Returns: it always returns RELAXNGGrammar, but due to the restriction imposed by Java language, I cannot change the signature of this method.

parse

public static TREXGrammar parse(InputSource grammar, GrammarReaderController controller)
loads RELAX NG pattern.

Returns: it always returns RELAXNGGrammar, but due to the restriction imposed by Java language, I cannot change the signature of this method.

startElement

public void startElement(String uri, String local, String qname, Attributes atts)

wrapUp

public void wrapUp()