com.sun.msv.reader.trex
Class DefineState

java.lang.Object
  extended by com.sun.msv.reader.State
      extended by com.sun.msv.reader.SimpleState
          extended by com.sun.msv.reader.trex.DefineState
All Implemented Interfaces:
ExpressionOwner, ContentHandler
Direct Known Subclasses:
DefineState, DefineState

public abstract class DefineState
extends SimpleState
implements ExpressionOwner

parses <define> declaration.

Author:
Kohsuke KAWAGUCHI

Field Summary
protected  Expression exp
          expression object that is being created.
 
Fields inherited from class com.sun.msv.reader.State
baseURI, location, parentState, reader, startTag
 
Constructor Summary
DefineState()
           
 
Method Summary
protected  State createChildState(StartTagInfo tag)
          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()
          this method is called in endElement method when the state is about to be removed.
 ReferenceExp getRef()
          Obtains a ReferenceExp that represents the target pattern block.
protected  ReferenceExp getReference()
           
 void onEndChild(Expression child)
          receives a Pattern object that is contained in this element.
protected  void startSelf()
          performs a task that should be done before reading any child elements.
 
Methods inherited from class com.sun.msv.reader.SimpleState
endDocument, endElement, isGrammarElement, startElement
 
Methods inherited from class com.sun.msv.reader.State
_assert, callInterceptExpression, characters, endPrefixMapping, getBaseURI, getLocation, getParentState, getStartTag, ignorableWhitespace, init, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exp

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

Constructor Detail

DefineState

public DefineState()
Method Detail

getRef

public final ReferenceExp getRef()
Obtains a ReferenceExp that represents the target pattern block.

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

onEndChild

public final void onEndChild(Expression child)
receives a Pattern object that is contained in this element.

Specified by:
onEndChild in interface ExpressionOwner

startSelf

protected void startSelf()
Description copied from class: State
performs a task that should be done before reading any child elements. derived-class can safely read startTag and/or parentState values.

Overrides:
startSelf in class State

endSelf

protected void endSelf()
Description copied from class: SimpleState
this method is called in endElement method when the state is about to be removed. derived-class should perform any wrap-up job

Overrides:
endSelf in class SimpleState

createChildState

protected State createChildState(StartTagInfo tag)
Description copied from class: SimpleState
creates appropriate child state object for this element

Specified by:
createChildState in class SimpleState

getReference

protected ReferenceExp getReference()
Returns:
null in case of error.

doCombine

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.



MSV