Class DefineState

All Implemented Interfaces:
ExpressionOwner, ContentHandler
Direct Known Subclasses:
DefineState, DefineState

public abstract class DefineState extends SimpleState implements ExpressionOwner
parses <define> declaration.
  • Field Details

    • exp

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

      private ReferenceExp ref
      Container to which the expression will be assigned.
  • Constructor Details

    • DefineState

      public DefineState()
  • Method Details

    • 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.