Package com.sun.msv.reader.relax
Class RELAXReader
java.lang.Object
org.xml.sax.helpers.XMLFilterImpl
com.sun.msv.reader.GrammarReader
com.sun.msv.reader.relax.RELAXReader
- All Implemented Interfaces:
IDContextProvider2,org.relaxng.datatype.ValidationContext,ContentHandler,DTDHandler,EntityResolver,ErrorHandler,XMLFilter,XMLReader
- Direct Known Subclasses:
RELAXCoreReader,RELAXNSReader
reads RELAX grammar/module by 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 StringNamespace URI of RELAX Corefinal RELAXReader.StateFactoryFields 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
ConstructorsConstructorDescriptionRELAXReader(GrammarReaderController controller, SAXParserFactory parserFactory, RELAXReader.StateFactory stateFactory, ExpressionPool pool, State initialState) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanHaveOccurs(State state) returns true if the given state can have "occurs" attribute.createExpressionChildState(State parent, StartTagInfo tag) this method must be implemented by the derived class to create language-default expresion state.createFacetState(State parent, StartTagInfo tag) protected ExpressionPoolgetPool()protected ExpressioninterceptExpression(State state, Expression exp) intercepts an expression made by ExpressionState before it is passed to the parent state.protected StringlocalizeMessage(String propertyName, Object[] args) formats localized message with argumentsprotected abstract ExpressionresolveElementRef(String namespace, String label) obtains an Expression specified by given (namespace,label) pair.protected abstract ExpressionresolveHedgeRef(String namespace, String label) obtains an Expression specified by given (namespace,label) pair.Methods inherited from class com.sun.msv.reader.GrammarReader
_parse, addBackPatchJob, addBackPatchJob, combineURI, combineURL, createParserFactory, detectUndefinedOnes, endPrefixMapping, getBackwardCompatibleType, getBaseUri, getCurrentState, getDeclaredLocationOf, getLocator, getResultAsGrammar, inputSourceFromLSInput, 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, endElement, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startElement, 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
-
RELAXCoreNamespace
Namespace URI of RELAX Core- See Also:
-
sfactory
-
ERR_ILLEGAL_OCCURS
- See Also:
-
ERR_MISPLACED_OCCURS
- See Also:
-
-
Constructor Details
-
RELAXReader
public RELAXReader(GrammarReaderController controller, SAXParserFactory parserFactory, RELAXReader.StateFactory stateFactory, ExpressionPool pool, State initialState)
-
-
Method Details
-
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.
-
createFacetState
-
canHaveOccurs
returns true if the given state can have "occurs" attribute. -
interceptExpression
Description copied from class:GrammarReaderintercepts an expression made by ExpressionState before it is passed to the parent state. derived class can perform further wrap-up before it is received by the parent. This mechanism is used by RELAXReader to handle occurs attribute.- Overrides:
interceptExpressionin classGrammarReader
-
resolveElementRef
obtains an Expression specified by given (namespace,label) pair. this method is called to parse <ref label="..." /> element. -
resolveHedgeRef
obtains an Expression specified by given (namespace,label) pair. this method is called to parse <hedgeRef label="..." /> element. -
localizeMessage
Description copied from class:GrammarReaderformats localized message with arguments- Specified by:
localizeMessagein classGrammarReader
-
getPool
-