Top Description Fields Constructors Methods
com.sun.msv.relaxns.reader

public Class RELAXNSReader

extends RELAXReader
Class Inheritance
Imports
javax.xml.parsers.SAXParserFactory, org.iso_relax.dispatcher.IslandSchemaReader, .SchemaProvider, org.relaxng.datatype.Datatype, org.xml.sax.InputSource, .SAXException, org.xml.sax.helpers.LocatorImpl, com.sun.msv.grammar.Expression, .ExpressionPool, .Grammar, com.sun.msv.reader.GrammarReaderController, com.sun.msv.reader.relax.RELAXReader, com.sun.msv.reader.trex.classic.TREXGrammarReader, com.sun.msv.relaxns.grammar.ExternalElementExp, .RELAXGrammar, com.sun.msv.util.StartTagInfo

parses RELAX Namespace XML and constructs a SchemaProvider.
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String
public final RELAXGrammar
grammar

RELAX grammar that is currentlt being loaded

public static final String
RELAXNamespaceNamespace

namespace URI of RELAX Namespace.

protected SchemaProvider
public static final String
Inherited from com.sun.msv.reader.relax.RELAXReader:
ERR_ILLEGAL_OCCURSERR_MISPLACED_OCCURSRELAXCoreNamespacesfactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public IslandSchemaReader

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.
getIslandSchemaReader
(String language, String expectedTargetNamespace)

creates an IslandSchemaReader that can parse the specified language.

public final RELAXGrammar
getResult()

obtains parsed grammar object only if parsing was successful.

public Grammar
public final SchemaProvider
getSchemaProvider()

obtains parsed grammar object as SchemaProvider only if parsing was successful.

protected boolean
isGrammarElement(StartTagInfo tag)

Implements abstract com.sun.msv.reader.GrammarReader.isGrammarElement.

checks if given element is that of the grammar elements.
protected String
localizeMessage(String propertyName, Object[] args)

Overrides com.sun.msv.reader.relax.RELAXReader.localizeMessage.

formats localized message with arguments
public static RELAXGrammar
parse(String moduleURL, SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool)

loads RELAX grammar

public static RELAXGrammar
parse(InputSource module, SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool)

loads RELAX grammar

public Datatype
protected Expression
resolveElementRef(String namespace, String label)

Implements abstract com.sun.msv.reader.relax.RELAXReader.resolveElementRef.

obtains an Expression specified by given (namespace,label) pair.
protected Expression
resolveHedgeRef(String namespace, String label)

Implements abstract com.sun.msv.reader.relax.RELAXReader.resolveHedgeRef.

obtains an Expression specified by given (namespace,label) pair.
private Expression
resolveRef(String namespace, String label, String tagName)

Inherited from com.sun.msv.reader.relax.RELAXReader:
canHaveOccurscreateExpressionChildStatecreateFacetStategetPoolinterceptExpression

Field Detail

ERR_INLINEMODULE_NOT_FOUNDback to summary
public static final String ERR_INLINEMODULE_NOT_FOUND
ERR_NAMESPACE_COLLISIONback to summary
public static final String ERR_NAMESPACE_COLLISION
ERR_TOPLEVEL_PARTICLE_MUST_BE_RELAX_COREback to summary
public static final String ERR_TOPLEVEL_PARTICLE_MUST_BE_RELAX_CORE
ERR_UNKNOWN_LANGUAGEback to summary
public static final String ERR_UNKNOWN_LANGUAGE
grammarback to summary
public final RELAXGrammar grammar

RELAX grammar that is currentlt being loaded

RELAXNamespaceNamespaceback to summary
public static final String RELAXNamespaceNamespace

namespace URI of RELAX Namespace.

schemaProviderback to summary
protected SchemaProvider schemaProvider
WRN_ILLEGAL_RELAXNAMESPACE_VERSIONback to summary
public static final String WRN_ILLEGAL_RELAXNAMESPACE_VERSION

Constructor Detail

RELAXNSReaderback to summary
public RELAXNSReader(GrammarReaderController controller, SAXParserFactory parserFactory, ExpressionPool pool)

Method Detail

getIslandSchemaReaderback to summary
public IslandSchemaReader getIslandSchemaReader(String language, String expectedTargetNamespace)

creates an IslandSchemaReader that can parse the specified language. This method can be overrided by the derived class to incorporate other language implementations.

Returns:IslandSchemaReader

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.

getResultback to summary
public final RELAXGrammar getResult()

obtains parsed grammar object only if parsing was successful.

getResultAsGrammarback to summary
public Grammar getResultAsGrammar()

Implements abstract com.sun.msv.reader.GrammarReader.getResultAsGrammar.

Doc from com.sun.msv.reader.GrammarReader.getResultAsGrammar.

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.

getSchemaProviderback to summary
public final SchemaProvider getSchemaProvider()

obtains parsed grammar object as SchemaProvider only if parsing was successful.

isGrammarElementback to summary
protected boolean isGrammarElement(StartTagInfo tag)

Implements abstract com.sun.msv.reader.GrammarReader.isGrammarElement.

Doc from com.sun.msv.reader.GrammarReader.isGrammarElement.

checks if given element is that of the grammar elements.

localizeMessageback to summary
protected String localizeMessage(String propertyName, Object[] args)

Overrides com.sun.msv.reader.relax.RELAXReader.localizeMessage.

Doc from com.sun.msv.reader.GrammarReader.localizeMessage.

formats localized message with arguments

parseback to summary
public static RELAXGrammar parse(String moduleURL, SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool)

loads RELAX grammar

parseback to summary
public static RELAXGrammar parse(InputSource module, SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool)

loads RELAX grammar

resolveDataTypeback to summary
public Datatype resolveDataType(String typeName)
resolveElementRefback to summary
protected Expression resolveElementRef(String namespace, String label)

Implements abstract com.sun.msv.reader.relax.RELAXReader.resolveElementRef.

Doc from com.sun.msv.reader.relax.RELAXReader.resolveElementRef.

obtains an Expression specified by given (namespace,label) pair. this method is called to parse <ref label="..." /> element.

resolveHedgeRefback to summary
protected Expression resolveHedgeRef(String namespace, String label)

Implements abstract com.sun.msv.reader.relax.RELAXReader.resolveHedgeRef.

Doc from com.sun.msv.reader.relax.RELAXReader.resolveHedgeRef.

obtains an Expression specified by given (namespace,label) pair. this method is called to parse <hedgeRef label="..." /> element.

resolveRefback to summary
private Expression resolveRef(String namespace, String label, String tagName)