Top Description Inners Fields Constructors Methods
com.sun.msv.reader.relax

public abstract Class RELAXReader

extends GrammarReader
Class Inheritance
Known Direct Subclasses
com.sun.msv.reader.relax.core.RELAXCoreReader, com.sun.msv.relaxns.reader.RELAXNSReader
Imports
java.text.MessageFormat, java.util.ResourceBundle, javax.xml.parsers.SAXParserFactory, com.sun.msv.grammar.Expression, .ExpressionPool, com.sun.msv.reader.ChoiceState, .GrammarReader, .GrammarReaderController, .SequenceState, .State, .TerminalState, com.sun.msv.reader.datatype.xsd.FacetState, com.sun.msv.reader.relax.core.InlineElementState, com.sun.msv.util.StartTagInfo

reads RELAX grammar/module by SAX2 and constructs abstract grammar model.
Author
Kohsuke KAWAGUCHI

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
RELAXReader.StateFactory

creates various State object, which in turn parses grammar.

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
RELAXCoreNamespace

Namespace URI of RELAX Core

public final RELAXReader.StateFactory
Inherited from com.sun.msv.reader.GrammarReader:
backwardReferencebasePrefixResolvercontrollerERR_BAD_ATTRIBUTE_VALUEERR_BAD_TYPEERR_CHARACTERSERR_CONFLICTING_ATTRIBUTESERR_DATATYPE_ALREADY_DEFINEDERR_DISALLOWED_ATTRIBUTEERR_FRAGMENT_IDENTIFIERERR_ILLEGAL_FINAL_VALUEERR_MALPLACED_ELEMENTERR_MISSING_ATTRIBUTEERR_MISSING_ATTRIBUTE_2ERR_MISSING_CHILD_EXPRESSIONERR_MISSING_CHILD_TYPEERR_MISSING_TOPLEVELERR_MORE_THAN_ONE_CHILD_EXPRESSIONERR_MORE_THAN_ONE_CHILD_TYPEERR_RECURSIVE_DATATYPEERR_RECURSIVE_INCLUDEERR_RUNAWAY_EXPRESSIONERR_UNDEFINED_DATATYPEparserFactorypoolprefixResolverWRN_DEPRECATED_TYPENAMEWRN_MAYBE_WRONG_NAMESPACE

Constructor Summary

AccessConstructor and Description
public
RELAXReader(GrammarReaderController controller, SAXParserFactory parserFactory, RELAXReader.StateFactory stateFactory, ExpressionPool pool, State initialState)

Method Summary

Modifier and TypeMethod and Description
protected boolean
canHaveOccurs(State state)

returns true if the given state can have "occurs" attribute.

public State
createExpressionChildState(State parent, StartTagInfo tag)

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

this method must be implemented by the derived class to create language-default expresion state.
public FacetState
protected ExpressionPool
protected Expression
interceptExpression(State state, Expression exp)

Overrides com.sun.msv.reader.GrammarReader.interceptExpression.

intercepts an expression made by ExpressionState before it is passed to the parent state.
protected String
localizeMessage(String propertyName, Object[] args)

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

formats localized message with arguments
protected 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.

Inherited from com.sun.msv.reader.GrammarReader:
_parseaddBackPatchJobaddBackPatchJobcombineURIcombineURLcreateParserFactorydetectUndefinedOnesendPrefixMappinggetBackwardCompatibleTypegetBaseUrigetCurrentStategetDeclaredLocationOfgetLocatorgetResultAsGrammarinputSourceFromLSInputisGrammarElementisNotationisUnparsedEntityiterateInscopeNamespacesonIDparseparseparsepopStatepushStatereportErrorreportErrorreportErrorreportErrorreportErrorreportErrorreportErrorreportErrorreportWarningreportWarningreportWarningreportWarningresolveLocationresolveNamespacePrefixrunBackPatchJobsetDeclaredLocationOfsetDocumentLocatorsetLocatorsplitQNamestartPrefixMappingswitchSourceswitchSourceswitchSource

Field Detail

ERR_ILLEGAL_OCCURSback to summary
public static final String ERR_ILLEGAL_OCCURS
ERR_MISPLACED_OCCURSback to summary
public static final String ERR_MISPLACED_OCCURS
RELAXCoreNamespaceback to summary
public static final String RELAXCoreNamespace

Namespace URI of RELAX Core

sfactoryback to summary
public final RELAXReader.StateFactory sfactory

Constructor Detail

RELAXReaderback to summary
public RELAXReader(GrammarReaderController controller, SAXParserFactory parserFactory, RELAXReader.StateFactory stateFactory, ExpressionPool pool, State initialState)

Method Detail

canHaveOccursback to summary
protected boolean canHaveOccurs(State state)

returns true if the given state can have "occurs" attribute.

createExpressionChildStateback to summary
public State createExpressionChildState(State parent, StartTagInfo tag)

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

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

this method must be implemented by the derived class to create language-default expresion state.

Returns:State

null if the start tag is an error.

createFacetStateback to summary
public FacetState createFacetState(State parent, StartTagInfo tag)
getPoolback to summary
protected ExpressionPool getPool()
interceptExpressionback to summary
protected Expression interceptExpression(State state, Expression exp)

Overrides com.sun.msv.reader.GrammarReader.interceptExpression.

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

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.

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

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

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

formats localized message with arguments

resolveElementRefback to summary
protected abstract Expression resolveElementRef(String namespace, String label)

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

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

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

com.sun.msv.reader.relax back to summary

public Class RELAXReader.StateFactory

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.msv.reader.relax.core.RELAXCoreReader.StateFactory

creates various State object, which in turn parses grammar. parsing behavior can be customized by implementing custom StateFactory.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected State
choice(State parent, StartTagInfo tag)

protected State
empty(State parent, StartTagInfo tag)

protected FacetState
facets(State parent, StartTagInfo tag)

protected State
protected State
none(State parent, StartTagInfo tag)

protected State
protected State
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StateFactoryback to summary
public StateFactory()

Method Detail

choiceback to summary
protected State choice(State parent, StartTagInfo tag)
emptyback to summary
protected State empty(State parent, StartTagInfo tag)
facetsback to summary
protected FacetState facets(State parent, StartTagInfo tag)
hedgeRefback to summary
protected State hedgeRef(State parent, StartTagInfo tag)
noneback to summary
protected State none(State parent, StartTagInfo tag)
refLabelback to summary
protected State refLabel(State parent, StartTagInfo tag)
sequenceback to summary
protected State sequence(State parent, StartTagInfo tag)