Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.msv.reader.trex.classic
Class TREXGrammarReader

    java.lang.Object
      org.xml.sax.helpers.XMLFilterImpl
          com.sun.msv.reader.GrammarReader
              com.sun.msv.reader.trex.TREXBaseReader
                  com.sun.msv.reader.trex.classic.TREXGrammarReader

All Implemented Interfaces:
  org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, IDContextProvider2, ValidationContext, org.xml.sax.XMLFilter, org.xml.sax.XMLReader, XSDatatypeResolver

public class TREXGrammarReader
extends TREXBaseReader
implements XSDatatypeResolver

reads TREX grammar from SAX2 and constructs abstract grammar model.

Author:
  Kohsuke KAWAGUCHI

Nested Class Summary
`static class` | `TREXGrammarReader.StateFactory` creates various State object, which in turn parses grammar.

Nested classes inherited from class com.sun.msv.reader.GrammarReader
`GrammarReader.BackPatch, GrammarReader.BackwardReferenceMap, GrammarReader.ChainPrefixResolver, GrammarReader.PrefixResolver`

Field Summary
`static java.lang.String` | `TREXNamespace` Namespace URI of TREX

Fields inherited from class com.sun.msv.reader.trex.TREXBaseReader
`ERR_BAD_COMBINE, ERR_COMBINE_MISSING, ERR_DUPLICATE_DEFINITION, ERR_INTERLEAVED_ANYSTRING, ERR_INTERLEAVED_STRING, ERR_MISSING_CHILD_NAMECLASS, ERR_MORE_THAN_ONE_NAMECLASS, ERR_NONEXISTENT_PARENT_GRAMMAR, ERR_REPEATED_STRING, ERR_SEQUENCED_STRING, ERR_UNDECLARED_PREFIX, ERR_UNDEFINED_PATTERN, ERR_UNKNOWN_DATATYPE_VOCABULARY, sfactory, WRN_COMBINE_IGNORED, WRN_OBSOLETED_XMLSCHEMA_NAMSPACE`

Fields inherited from class com.sun.msv.reader.GrammarReader
`backwardReference, basePrefixResolver, controller, ERR_BAD_ATTRIBUTE_VALUE, ERR_BAD_TYPE, ERR_CHARACTERS, ERR_CONFLICTING_ATTRIBUTES, ERR_DATATYPE_ALREADY_DEFINED, ERR_DISALLOWED_ATTRIBUTE, ERR_FRAGMENT_IDENTIFIER, ERR_ILLEGAL_FINAL_VALUE, ERR_MALPLACED_ELEMENT, ERR_MISSING_ATTRIBUTE, ERR_MISSING_ATTRIBUTE_2, ERR_MISSING_CHILD_EXPRESSION, ERR_MISSING_CHILD_TYPE, ERR_MISSING_TOPLEVEL, ERR_MORE_THAN_ONE_CHILD_EXPRESSION, ERR_MORE_THAN_ONE_CHILD_TYPE, ERR_RECURSIVE_DATATYPE, ERR_RECURSIVE_INCLUDE, ERR_RUNAWAY_EXPRESSION, ERR_UNDEFINED_DATATYPE, locator, parserFactory, pool, prefixResolver, WRN_DEPRECATED_TYPENAME, WRN_MAYBE_WRONG_NAMESPACE`

Constructor Summary
`TREXGrammarReader(GrammarReaderController controller)` easy-to-use constructor.
`TREXGrammarReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory, ExpressionPool pool)` easy-to-use constructor.
`TREXGrammarReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory, TREXGrammarReader.StateFactory stateFactory, ExpressionPool pool)` full constructor

Method Summary
`State` | `createExpressionChildState(State parent, StartTagInfo tag)` this method must be implemented by the derived class to create language-default expresion state.
`static TREXGrammar` | `parse(org.xml.sax.InputSource grammar, javax.xml.parsers.SAXParserFactory factory, GrammarReaderController controller)` loads TREX pattern
`static TREXGrammar` | `parse(java.lang.String grammarURL, javax.xml.parsers.SAXParserFactory factory, GrammarReaderController controller)` loads TREX pattern
`Datatype` | `resolveDatatype(java.lang.String qName)` obtains a named DataType object referenced by a QName.
`XSDatatypeExp` | `resolveXSDatatype(java.lang.String qName)`
`void` | `wrapUp()` performs final wrap-up.

Methods inherited from class com.sun.msv.reader.trex.TREXBaseReader
`endElement, getResult, getResultAsGrammar, getTargetNamespace, startElement`

Methods inherited from class com.sun.msv.reader.GrammarReader
`_parse, addBackPatchJob, addBackPatchJob, combineURI, combineURL, detectUndefinedOnes, endPrefixMapping, getBackwardCompatibleType, getBaseUri, getCurrentState, getDeclaredLocationOf, isNotation, isUnparsedEntity, iterateInscopeNamespaces, onID, parse, parse, popState, pushState, reportError, reportError, reportError, reportError, reportError, reportError, reportError, reportError, reportWarning, reportWarning, reportWarning, reportWarning, resolveLocation, resolveNamespacePrefix, runBackPatchJob, setDeclaredLocationOf, setDocumentLocator, splitQName, startPrefixMapping, switchSource, switchSource`

Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
`characters, endDocument, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, unparsedEntityDecl, warning`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TREXNamespace

    public static final java.lang.String TREXNamespace

  Namespace URI of TREX

  See Also:
    Constant Field Values

Constructor Detail

### TREXGrammarReader

    public TREXGrammarReader(GrammarReaderController controller)

  easy-to-use constructor.

### TREXGrammarReader

    public TREXGrammarReader(GrammarReaderController controller,
                             javax.xml.parsers.SAXParserFactory parserFactory,
                             ExpressionPool pool)

  easy-to-use constructor.

### TREXGrammarReader

    public TREXGrammarReader(GrammarReaderController controller,
                             javax.xml.parsers.SAXParserFactory parserFactory,
                             TREXGrammarReader.StateFactory stateFactory,
                             ExpressionPool pool)

  full constructor

Method Detail

### parse

    public static TREXGrammar parse(java.lang.String grammarURL,
                                    javax.xml.parsers.SAXParserFactory factory,
                                    GrammarReaderController controller)

  loads TREX pattern

### parse

    public static TREXGrammar parse(org.xml.sax.InputSource grammar,
                                    javax.xml.parsers.SAXParserFactory factory,
                                    GrammarReaderController controller)

  loads TREX pattern

### createExpressionChildState

    public State createExpressionChildState(State parent,
                                            StartTagInfo tag)

  Description copied from class: `GrammarReader`
  this method must be implemented by the derived class to create language-default expresion state.

  Overrides:
    `createExpressionChildState` in class `TREXBaseReader`

### resolveXSDatatype

    public XSDatatypeExp resolveXSDatatype(java.lang.String qName)

  Specified by:
    `resolveXSDatatype` in interface `XSDatatypeResolver`
  Parameters:
    `qName` - The type of this value varies in the schema language. In XML Schema, for example, in which QNames are used to designate datatypes, this parameter will be QName. In RELAX Core, in which the same syntax is used but NCName is used to designate datatypes. So this parameter will be NCName.
  Returns:
    A non-null valid object. An error should be reported and recovered by the callee.

### resolveDatatype

    public Datatype resolveDatatype(java.lang.String qName)

  obtains a named DataType object referenced by a QName.

### wrapUp

    public void wrapUp()

  Description copied from class: `TREXBaseReader`
  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.

  Overrides:
    `wrapUp` in class `TREXBaseReader`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD