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.
- Author:
- Kohsuke KAWAGUCHI
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classcreates 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 Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected TREXGrammargrammar object currently being loaded.protected Stringtarget namespace: currently active 'ns' attributestatic final Stringstatic final StringFields 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 StatecreateNameClassChildState(State parent, StartTagInfo tag) voidendElement(String a, String b, String c) final TREXGrammarobtains parsed grammar object only if parsing was successful.gets the parsed AGM.final Stringprotected StringlocalizeMessage(String propertyName, Object[] args) formats localized message with argumentsvoidstartElement(String a, String b, String c, Attributes d) voidwrapUp()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, switchSourceMethods 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, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
grammar
grammar object currently being loaded. -
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:GrammarReaderformats localized message with arguments- Specified by:
localizeMessagein classGrammarReader
-
getResult
obtains parsed grammar object only if parsing was successful. -
getResultAsGrammar
Description copied from class:GrammarReadergets 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:
getResultAsGrammarin classGrammarReader
-
getTargetNamespace
-
createNameClassChildState
-
createExpressionChildState
Description copied from class:GrammarReaderthis method must be implemented by the derived class to create language-default expresion state.- Specified by:
createExpressionChildStatein 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:
startElementin interfaceContentHandler- Overrides:
startElementin classXMLFilterImpl- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classXMLFilterImpl- Throws:
SAXException
-