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

public abstract Class DefineState

extends SimpleState
implements ExpressionOwner
Class Inheritance
All Implemented Interfaces
com.sun.msv.reader.ExpressionOwner
Known Direct Subclasses
com.sun.msv.reader.trex.classic.DefineState, com.sun.msv.reader.trex.ng.DefineState
Imports
com.sun.msv.grammar.Expression, .ReferenceExp, com.sun.msv.reader.ExpressionOwner, .GrammarReader, .SimpleState, .State, com.sun.msv.util.StartTagInfo

parses <define> declaration.
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
protected Expression
exp

expression object that is being created.

private ReferenceExp
ref

Container to which the expression will be assigned.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected State
createChildState(StartTagInfo tag)

Implements abstract com.sun.msv.reader.SimpleState.createChildState.

creates appropriate child state object for this element
protected abstract Expression
doCombine(ReferenceExp baseExp, Expression newExp, String combine)

combines two expressions into one as specified by the combine parameter, and returns a new expression.

protected void
endSelf()

Overrides com.sun.msv.reader.SimpleState.endSelf.

this method is called in endElement method when the state is about to be removed.
public final ReferenceExp

Returns:

null If there was an error in the input, this method may return null.
getRef
()

Obtains a ReferenceExp that represents the target pattern block.

protected ReferenceExp

Returns:

null in case of error.
getReference
()

public final void
onEndChild(Expression child)

Implements com.sun.msv.reader.ExpressionOwner.onEndChild.

receives a Pattern object that is contained in this element.
protected void
startSelf()

Overrides com.sun.msv.reader.State.startSelf.

performs a task that should be done before reading any child elements.
Inherited from com.sun.msv.reader.SimpleState:
endDocumentendElementisGrammarElementstartElement

Field Detail

expback to summary
protected Expression exp

expression object that is being created. See castPattern and annealPattern methods for how will a pattern be created.

refback to summary
private ReferenceExp ref

Container to which the expression will be assigned.

Constructor Detail

DefineStateback to summary
public DefineState()

Method Detail

createChildStateback to summary
protected State createChildState(StartTagInfo tag)

Implements abstract com.sun.msv.reader.SimpleState.createChildState.

Doc from com.sun.msv.reader.SimpleState.createChildState.

creates appropriate child state object for this element

doCombineback to summary
protected abstract Expression doCombine(ReferenceExp baseExp, Expression newExp, String combine)

combines two expressions into one as specified by the combine parameter, and returns a new expression. If the combine parameter is invalid, then return null.

endSelfback to summary
protected void endSelf()

Overrides com.sun.msv.reader.SimpleState.endSelf.

Doc from com.sun.msv.reader.SimpleState.endSelf.

this method is called in endElement method when the state is about to be removed. derived-class should perform any wrap-up job

getRefback to summary
public final ReferenceExp getRef()

Obtains a ReferenceExp that represents the target pattern block.

Returns:ReferenceExp

null If there was an error in the input, this method may return null.

getReferenceback to summary
protected ReferenceExp getReference()
Returns:ReferenceExp

null in case of error.

onEndChildback to summary
public final void onEndChild(Expression child)

Implements com.sun.msv.reader.ExpressionOwner.onEndChild.

receives a Pattern object that is contained in this element.

startSelfback to summary
protected void startSelf()

Overrides com.sun.msv.reader.State.startSelf.

Doc from com.sun.msv.reader.State.startSelf.

performs a task that should be done before reading any child elements. derived-class can safely read startTag and/or parentState values.