Package com.sun.msv.relaxns.reader
Class RELAXNSReader
java.lang.Object
org.xml.sax.helpers.XMLFilterImpl
com.sun.msv.reader.GrammarReader
com.sun.msv.reader.relax.RELAXReader
com.sun.msv.relaxns.reader.RELAXNSReader
- All Implemented Interfaces:
IDContextProvider2,org.relaxng.datatype.ValidationContext,ContentHandler,DTDHandler,EntityResolver,ErrorHandler,XMLFilter,XMLReader
parses RELAX Namespace XML and constructs a SchemaProvider.
- Author:
- Kohsuke KAWAGUCHI
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.msv.reader.relax.RELAXReader
RELAXReader.StateFactoryNested 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 Stringfinal RELAXGrammarRELAX grammar that is currentlt being loadedstatic final Stringnamespace URI of RELAX Namespace.protected org.iso_relax.dispatcher.SchemaProviderstatic final StringFields inherited from class com.sun.msv.reader.relax.RELAXReader
ERR_ILLEGAL_OCCURS, ERR_MISPLACED_OCCURS, RELAXCoreNamespace, sfactoryFields 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
ConstructorsConstructorDescriptionRELAXNSReader(GrammarReaderController controller, SAXParserFactory parserFactory, ExpressionPool pool) -
Method Summary
Modifier and TypeMethodDescriptionorg.iso_relax.dispatcher.IslandSchemaReadergetIslandSchemaReader(String language, String expectedTargetNamespace) creates anIslandSchemaReaderthat can parse the specified language.final RELAXGrammarobtains parsed grammar object only if parsing was successful.gets the parsed AGM.final org.iso_relax.dispatcher.SchemaProviderobtains parsed grammar object as SchemaProvider only if parsing was successful.protected booleanchecks if given element is that of the grammar elements.protected StringlocalizeMessage(String propertyName, Object[] args) formats localized message with argumentsstatic RELAXGrammarparse(String moduleURL, SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool) loads RELAX grammarstatic RELAXGrammarparse(InputSource module, SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool) loads RELAX grammarorg.relaxng.datatype.DatatyperesolveDataType(String typeName) protected ExpressionresolveElementRef(String namespace, String label) obtains an Expression specified by given (namespace,label) pair.protected ExpressionresolveHedgeRef(String namespace, String label) obtains an Expression specified by given (namespace,label) pair.Methods inherited from class com.sun.msv.reader.relax.RELAXReader
canHaveOccurs, createExpressionChildState, createFacetState, getPool, interceptExpressionMethods inherited from class com.sun.msv.reader.GrammarReader
_parse, addBackPatchJob, addBackPatchJob, combineURI, combineURL, createParserFactory, detectUndefinedOnes, endPrefixMapping, getBackwardCompatibleType, getBaseUri, getCurrentState, getDeclaredLocationOf, getLocator, inputSourceFromLSInput, 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
-
RELAXNamespaceNamespace
namespace URI of RELAX Namespace.- See Also:
-
grammar
RELAX grammar that is currentlt being loaded -
schemaProvider
protected org.iso_relax.dispatcher.SchemaProvider schemaProvider -
WRN_ILLEGAL_RELAXNAMESPACE_VERSION
- See Also:
-
ERR_TOPLEVEL_PARTICLE_MUST_BE_RELAX_CORE
- See Also:
-
ERR_INLINEMODULE_NOT_FOUND
- See Also:
-
ERR_UNKNOWN_LANGUAGE
- See Also:
-
ERR_NAMESPACE_COLLISION
- See Also:
-
-
Constructor Details
-
RELAXNSReader
public RELAXNSReader(GrammarReaderController controller, SAXParserFactory parserFactory, ExpressionPool pool)
-
-
Method Details
-
parse
public static RELAXGrammar parse(String moduleURL, SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool) loads RELAX grammar -
parse
public static RELAXGrammar parse(InputSource module, SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool) loads RELAX grammar -
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
-
getSchemaProvider
public final org.iso_relax.dispatcher.SchemaProvider getSchemaProvider()obtains parsed grammar object as SchemaProvider only if parsing was successful. -
getIslandSchemaReader
public org.iso_relax.dispatcher.IslandSchemaReader getIslandSchemaReader(String language, String expectedTargetNamespace) creates anIslandSchemaReaderthat can parse the specified language. This method can be overrided by the derived class to incorporate other language implementations.- Returns:
- return null if the given language is unrecognized. error will be handled by the caller. So this method should not attempt to report nor recover from error.
-
resolveDataType
-
isGrammarElement
Description copied from class:GrammarReaderchecks if given element is that of the grammar elements.- Specified by:
isGrammarElementin classGrammarReader
-
resolveElementRef
Description copied from class:RELAXReaderobtains an Expression specified by given (namespace,label) pair. this method is called to parse <ref label="..." /> element.- Specified by:
resolveElementRefin classRELAXReader
-
resolveHedgeRef
Description copied from class:RELAXReaderobtains an Expression specified by given (namespace,label) pair. this method is called to parse <hedgeRef label="..." /> element.- Specified by:
resolveHedgeRefin classRELAXReader
-
localizeMessage
Description copied from class:GrammarReaderformats localized message with arguments- Overrides:
localizeMessagein classRELAXReader
-