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
Class TREXBaseReader

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

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

Direct Known Subclasses:
  RELAXNGReader, TREXGrammarReader

public abstract class TREXBaseReader
extends GrammarReader

reads TREX grammar from SAX2 and constructs abstract grammar model.

Author:
  Kohsuke KAWAGUCHI

Nested Class Summary
`static class` | `TREXBaseReader.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` | `ERR_BAD_COMBINE`
`static java.lang.String` | `ERR_COMBINE_MISSING`
`static java.lang.String` | `ERR_DUPLICATE_DEFINITION`
`static java.lang.String` | `ERR_INTERLEAVED_ANYSTRING`
`static java.lang.String` | `ERR_INTERLEAVED_STRING`
`static java.lang.String` | `ERR_MISSING_CHILD_NAMECLASS`
`static java.lang.String` | `ERR_MORE_THAN_ONE_NAMECLASS`
`static java.lang.String` | `ERR_NONEXISTENT_PARENT_GRAMMAR`
`static java.lang.String` | `ERR_REPEATED_STRING`
`static java.lang.String` | `ERR_SEQUENCED_STRING`
`static java.lang.String` | `ERR_UNDECLARED_PREFIX`
`static java.lang.String` | `ERR_UNDEFINED_PATTERN`
`static java.lang.String` | `ERR_UNKNOWN_DATATYPE_VOCABULARY`
`TREXBaseReader.StateFactory` | `sfactory`
`static java.lang.String` | `WRN_COMBINE_IGNORED`
`static java.lang.String` | `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
`TREXBaseReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory, ExpressionPool pool, TREXBaseReader.StateFactory stateFactory, State rootState)` 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.
`void` | `endElement(java.lang.String a, java.lang.String b, java.lang.String c)`
`TREXGrammar` | `getResult()` obtains parsed grammar object only if parsing was successful.
`Grammar` | `getResultAsGrammar()` gets the parsed AGM.
`java.lang.String` | `getTargetNamespace()`
`void` | `startElement(java.lang.String a, java.lang.String b, java.lang.String c, org.xml.sax.Attributes d)`
`void` | `wrapUp()` performs final wrap-up.

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

### sfactory

    public final TREXBaseReader.StateFactory sfactory

### ERR_MISSING_CHILD_NAMECLASS

    public static final java.lang.String ERR_MISSING_CHILD_NAMECLASS

See Also:
  Constant Field Values

### ERR_MORE_THAN_ONE_NAMECLASS

    public static final java.lang.String ERR_MORE_THAN_ONE_NAMECLASS

See Also:
  Constant Field Values

### ERR_UNDECLARED_PREFIX

    public static final java.lang.String ERR_UNDECLARED_PREFIX

See Also:
  Constant Field Values

### ERR_UNDEFINED_PATTERN

    public static final java.lang.String ERR_UNDEFINED_PATTERN

See Also:
  Constant Field Values

### ERR_UNKNOWN_DATATYPE_VOCABULARY

    public static final java.lang.String ERR_UNKNOWN_DATATYPE_VOCABULARY

See Also:
  Constant Field Values

### ERR_BAD_COMBINE

    public static final java.lang.String ERR_BAD_COMBINE

See Also:
  Constant Field Values

### ERR_COMBINE_MISSING

    public static final java.lang.String ERR_COMBINE_MISSING

See Also:
  Constant Field Values

### WRN_COMBINE_IGNORED

    public static final java.lang.String WRN_COMBINE_IGNORED

See Also:
  Constant Field Values

### WRN_OBSOLETED_XMLSCHEMA_NAMSPACE

    public static final java.lang.String WRN_OBSOLETED_XMLSCHEMA_NAMSPACE

See Also:
  Constant Field Values

### ERR_DUPLICATE_DEFINITION

    public static final java.lang.String ERR_DUPLICATE_DEFINITION

See Also:
  Constant Field Values

### ERR_NONEXISTENT_PARENT_GRAMMAR

    public static final java.lang.String ERR_NONEXISTENT_PARENT_GRAMMAR

See Also:
  Constant Field Values

### ERR_INTERLEAVED_STRING

    public static final java.lang.String ERR_INTERLEAVED_STRING

See Also:
  Constant Field Values

### ERR_SEQUENCED_STRING

    public static final java.lang.String ERR_SEQUENCED_STRING

See Also:
  Constant Field Values

### ERR_REPEATED_STRING

    public static final java.lang.String ERR_REPEATED_STRING

See Also:
  Constant Field Values

### ERR_INTERLEAVED_ANYSTRING

    public static final java.lang.String ERR_INTERLEAVED_ANYSTRING

See Also:
  Constant Field Values

Constructor Detail

### TREXBaseReader

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

  full constructor

Method Detail

### getResult

    public final TREXGrammar getResult()

  obtains parsed grammar object only if parsing was successful.

### getResultAsGrammar

    public Grammar getResultAsGrammar()

  Description copied from class: `GrammarReader`
  gets the parsed AGM. Should any error happens, this method should returns null. derived classes should implement type-safe getGrammar method, along with this method.

  Specified by:
    `getResultAsGrammar` in class `GrammarReader`

### getTargetNamespace

    public final java.lang.String getTargetNamespace()

### 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.

  Specified by:
    `createExpressionChildState` in class `GrammarReader`
  Returns:
    null if the start tag is an error.

### 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.

### startElement

    public void startElement(java.lang.String a,
                             java.lang.String b,
                             java.lang.String c,
                             org.xml.sax.Attributes d)
                      throws org.xml.sax.SAXException

  Throws:
    `org.xml.sax.SAXException`

### endElement

    public void endElement(java.lang.String a,
                           java.lang.String b,
                           java.lang.String c)
                    throws org.xml.sax.SAXException

  Throws:
    `org.xml.sax.SAXException`

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