Package 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:
IDContextProvider2
,org.relaxng.datatype.ValidationContext
,ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,XMLFilter
,XMLReader
- Direct Known Subclasses:
RELAXNGReader
,TREXGrammarReader
reads TREX grammar from SAX2 and constructs abstract grammar model.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
creates various State object, which in turn parses grammar.Nested classes/interfaces inherited from class com.sun.msv.reader.GrammarReader
GrammarReader.BackPatch, GrammarReader.BackwardReferenceMap, GrammarReader.ChainPrefixResolver, GrammarReader.PrefixResolver
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected TREXGrammar
grammar object currently being loaded.private LightStack
stack that stores value of ancestor 'ns' attribute.protected String
target namespace: currently active 'ns' attributestatic final String
static final String
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, parserFactory, pool, prefixResolver, WRN_DEPRECATED_TYPENAME, WRN_MAYBE_WRONG_NAMESPACE
-
Constructor Summary
ConstructorsConstructorDescriptionTREXBaseReader
(GrammarReaderController controller, SAXParserFactory parserFactory, ExpressionPool pool, TREXBaseReader.StateFactory stateFactory, State rootState) full constructor -
Method Summary
Modifier and TypeMethodDescriptioncreateExpressionChildState
(State parent, StartTagInfo tag) this method must be implemented by the derived class to create language-default expresion state.protected State
createNameClassChildState
(State parent, StartTagInfo tag) void
endElement
(String a, String b, String c) final TREXGrammar
obtains parsed grammar object only if parsing was successful.gets the parsed AGM.final String
protected String
localizeMessage
(String propertyName, Object[] args) formats localized message with argumentsvoid
startElement
(String a, String b, String c, Attributes d) void
wrapUp()
performs final wrap-up.Methods inherited from class com.sun.msv.reader.GrammarReader
_parse, addBackPatchJob, addBackPatchJob, combineURI, combineURL, createParserFactory, detectUndefinedOnes, endPrefixMapping, getBackwardCompatibleType, getBaseUri, getCurrentState, getDeclaredLocationOf, getLocator, inputSourceFromLSInput, interceptExpression, isGrammarElement, isNotation, isUnparsedEntity, iterateInscopeNamespaces, onID, parse, parse, parse, popState, pushState, reportError, reportError, reportError, reportError, reportError, reportError, reportError, reportError, reportWarning, reportWarning, reportWarning, reportWarning, resolveLocation, resolveNamespacePrefix, runBackPatchJob, setDeclaredLocationOf, setDocumentLocator, setLocator, splitQName, startPrefixMapping, switchSource, 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
-
Field Details
-
grammar
grammar object currently being loaded. -
nsStack
stack that stores value of ancestor 'ns' attribute. -
targetNamespace
target namespace: currently active 'ns' attribute -
sfactory
-
ERR_MISSING_CHILD_NAMECLASS
- See Also:
-
ERR_MORE_THAN_ONE_NAMECLASS
- See Also:
-
ERR_UNDECLARED_PREFIX
- See Also:
-
ERR_UNDEFINED_PATTERN
- See Also:
-
ERR_UNKNOWN_DATATYPE_VOCABULARY
- See Also:
-
ERR_BAD_COMBINE
- See Also:
-
ERR_COMBINE_MISSING
- See Also:
-
WRN_COMBINE_IGNORED
- See Also:
-
WRN_OBSOLETED_XMLSCHEMA_NAMSPACE
- See Also:
-
ERR_DUPLICATE_DEFINITION
- See Also:
-
ERR_NONEXISTENT_PARENT_GRAMMAR
- See Also:
-
ERR_INTERLEAVED_STRING
- See Also:
-
ERR_SEQUENCED_STRING
- See Also:
-
ERR_REPEATED_STRING
- See Also:
-
ERR_INTERLEAVED_ANYSTRING
- See Also:
-
-
Constructor Details
-
TREXBaseReader
public TREXBaseReader(GrammarReaderController controller, SAXParserFactory parserFactory, ExpressionPool pool, TREXBaseReader.StateFactory stateFactory, State rootState) full constructor
-
-
Method Details
-
localizeMessage
Description copied from class:GrammarReader
formats localized message with arguments- Specified by:
localizeMessage
in classGrammarReader
-
getResult
obtains parsed grammar object only if parsing was successful. -
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 classGrammarReader
-
getTargetNamespace
-
createNameClassChildState
-
createExpressionChildState
Description copied from class:GrammarReader
this method must be implemented by the derived class to create language-default expresion state.- Specified by:
createExpressionChildState
in classGrammarReader
- 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
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classXMLFilterImpl
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classXMLFilterImpl
- Throws:
SAXException
-