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.
-
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
Namespace URI of RELAX Corefinal RELAXReader.StateFactory
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
ConstructorsConstructorDescriptionRELAXReader
(GrammarReaderController controller, SAXParserFactory parserFactory, RELAXReader.StateFactory stateFactory, ExpressionPool pool, State initialState) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canHaveOccurs
(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 ExpressionPool
getPool()
protected Expression
interceptExpression
(State state, Expression exp) intercepts an expression made by ExpressionState before it is passed to the parent state.protected String
localizeMessage
(String propertyName, Object[] args) formats localized message with argumentsprotected abstract Expression
resolveElementRef
(String namespace, String label) obtains an Expression specified by given (namespace,label) pair.protected abstract Expression
resolveHedgeRef
(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, switchSource
Methods 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, warning
-
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: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.
-
createFacetState
-
canHaveOccurs
returns true if the given state can have "occurs" attribute. -
interceptExpression
Description copied from class:GrammarReader
intercepts 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:
interceptExpression
in 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:GrammarReader
formats localized message with arguments- Specified by:
localizeMessage
in classGrammarReader
-
getPool
-