Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.milligan.eccles
Class RunStateImpl  view RunStateImpl download RunStateImpl.java

java.lang.Object
  extended byorg.milligan.eccles.RunStateImpl
All Implemented Interfaces:
RunState, RunStateEx

class RunStateImpl
extends java.lang.Object
implements RunStateEx


Field Summary
static org.milligan.eccles.evaluator.Evaluator evaluator
          Object for performing evaluations
protected static org.apache.log4j.Category log
           
protected  org.w3c.dom.Element outputElement
          Output Element
protected  RunStateImpl parent
          Parent runstate
protected  java.util.Map privateProperties
          Map of private properties
protected  java.util.Map properties
          Map of properties
protected  EcclesRunner runner
          Reference to single runner container object
protected  Tag runningTag
          Reference to the tag currently running inside this state
 
Constructor Summary
(package private) RunStateImpl(EcclesRunner runner, Tag tag)
          Constructor
(package private) RunStateImpl(RunStateImpl parent, Tag tag)
          Constructor
 
Method Summary
 void addMessage(java.lang.String message, java.lang.String code)
          Add an output message
 void addMessage(java.lang.String message, java.lang.String href, java.lang.String reportType)
          Add an output message
 void addMessageWithHref(java.lang.String message, java.lang.String href)
          Write a message node to output element report file, optionally with a url
 EcclesReturnValue callTag(java.lang.String id)
          Call a globally named test article and return the value from its doEndTag
 void changeProperty(java.lang.String id, java.lang.Object o)
          Find the first property named and change its value.
 java.lang.Object evaluate(java.lang.String input, java.lang.Class expectedType)
          evaluate an equation
 java.lang.Boolean evaluateBoolean(java.lang.String input)
          evaluate an equation
 java.lang.Long evaluateLong(java.lang.String input)
          evaluate an equation
 java.lang.String evaluateString(java.lang.String input)
          evaluate an equation
 java.lang.Object findProperty(java.lang.String id)
          Find the specified property, searching all the parents.
 org.w3c.dom.Document getOutputDocument()
          retrive the base output document
 org.w3c.dom.Element getOutputElement()
          Retrieve the output Element
 RunState getParent()
          Get the parent state
 org.w3c.dom.Node getParentElement()
          Return a parent element for this output element
 java.lang.Object getParentProperty(java.lang.String id)
          Get the specified property from the parent.
 RunStateImpl getParentState()
          Get the parent runstate object
 java.lang.Object getPrivateProperty(java.lang.String property)
          Get a property in the tag's private area.
protected  java.util.Map getProperties()
          Retrieve the property map
 java.lang.Object getProperty(java.lang.String id)
          Get the specified property.
 java.lang.Object getProperty(java.lang.String id, boolean searchParents)
          Get the specified property, optionally searching all the parents for the property.
 java.util.Map getReportTypeMap()
          Get a map of all registered report types
 EcclesRunner getRunner()
          Return the enclosing runner object
 Tag getTag()
          Get the tag object
 java.lang.Class getTagClass()
          Return the class type of the tag pointed to by the state
 void incrementResultType(java.lang.String reportType)
           
 boolean removeParentProperty(java.lang.String id)
          Remove a property from the parent scope.
 EcclesReturnValue run()
          Perform the action of running the tag and it's children
private  EcclesReturnValue runChildLoop()
          Run the child tags.
 EcclesReturnValue runChildren()
          Actually call the child tags
 void setParentProperty(java.lang.String id, java.lang.Object o)
          Set a property at the parent level, available to this tag and its children, plus the siblings of the current tag
 void setPrivateProperty(java.lang.String property, java.lang.Object value)
          Set a property in the tag's private area.
 void setProperty(java.lang.String id, java.lang.Object o)
          Set a property at the current level, only available to this tag and its children
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Category log

evaluator

public static org.milligan.eccles.evaluator.Evaluator evaluator
Object for performing evaluations


parent

protected RunStateImpl parent
Parent runstate


runningTag

protected Tag runningTag
Reference to the tag currently running inside this state


runner

protected EcclesRunner runner
Reference to single runner container object


properties

protected java.util.Map properties
Map of properties


privateProperties

protected java.util.Map privateProperties
Map of private properties


outputElement

protected org.w3c.dom.Element outputElement
Output Element

Constructor Detail

RunStateImpl

RunStateImpl(EcclesRunner runner,
             Tag tag)
Constructor


RunStateImpl

RunStateImpl(RunStateImpl parent,
             Tag tag)
Constructor

Method Detail

getParentState

public RunStateImpl getParentState()
Get the parent runstate object


getParent

public RunState getParent()
Get the parent state

Specified by:
getParent in interface RunState

run

public EcclesReturnValue run()
Perform the action of running the tag and it's children


runChildLoop

private EcclesReturnValue runChildLoop()
Run the child tags. This function performs the external control on child tags - calling the doInitChildren, doAfterChildren and doFinishChildren functions, handing control of actually calling the children to runChildren.


runChildren

public EcclesReturnValue runChildren()
Actually call the child tags


getTagClass

public java.lang.Class getTagClass()
Description copied from interface: RunState
Return the class type of the tag pointed to by the state

Specified by:
getTagClass in interface RunState

callTag

public EcclesReturnValue callTag(java.lang.String id)
Call a globally named test article and return the value from its doEndTag

Specified by:
callTag in interface RunState

getRunner

public EcclesRunner getRunner()
Return the enclosing runner object


setProperty

public void setProperty(java.lang.String id,
                        java.lang.Object o)
Set a property at the current level, only available to this tag and its children

Specified by:
setProperty in interface RunState

setParentProperty

public void setParentProperty(java.lang.String id,
                              java.lang.Object o)
Set a property at the parent level, available to this tag and its children, plus the siblings of the current tag

Specified by:
setParentProperty in interface RunState

changeProperty

public void changeProperty(java.lang.String id,
                           java.lang.Object o)
Find the first property named and change its value. Throws an exception if it cant be found

Specified by:
changeProperty in interface RunState

removeParentProperty

public boolean removeParentProperty(java.lang.String id)
Remove a property from the parent scope. Useful for logic tags like if and try.

Specified by:
removeParentProperty in interface RunState

getProperty

public java.lang.Object getProperty(java.lang.String id,
                                    boolean searchParents)
Get the specified property, optionally searching all the parents for the property.

Specified by:
getProperty in interface RunState

getProperty

public java.lang.Object getProperty(java.lang.String id)
Get the specified property. Starts at this tag and walks all the way back up looking for the property, and is a wrapper for getProprety(id, true)

Specified by:
getProperty in interface RunState

evaluate

public java.lang.Object evaluate(java.lang.String input,
                                 java.lang.Class expectedType)
                          throws EcclesException
Description copied from interface: RunState
evaluate an equation

Specified by:
evaluate in interface RunState

evaluateString

public java.lang.String evaluateString(java.lang.String input)
                                throws EcclesException
Description copied from interface: RunState
evaluate an equation

Specified by:
evaluateString in interface RunState

evaluateLong

public java.lang.Long evaluateLong(java.lang.String input)
                            throws EcclesException
evaluate an equation

Specified by:
evaluateLong in interface RunState

evaluateBoolean

public java.lang.Boolean evaluateBoolean(java.lang.String input)
                                  throws EcclesException
evaluate an equation

Specified by:
evaluateBoolean in interface RunState

getProperties

protected java.util.Map getProperties()
Retrieve the property map


getTag

public Tag getTag()
Get the tag object

Specified by:
getTag in interface RunStateEx

getParentProperty

public java.lang.Object getParentProperty(java.lang.String id)
Get the specified property from the parent.

Specified by:
getParentProperty in interface RunState

findProperty

public java.lang.Object findProperty(java.lang.String id)
Find the specified property, searching all the parents. If the property cannot be found, throws an exception

Specified by:
findProperty in interface RunState

getParentElement

public org.w3c.dom.Node getParentElement()
Return a parent element for this output element


getOutputElement

public org.w3c.dom.Element getOutputElement()
Retrieve the output Element

Specified by:
getOutputElement in interface RunState

getOutputDocument

public org.w3c.dom.Document getOutputDocument()
Description copied from interface: RunState
retrive the base output document

Specified by:
getOutputDocument in interface RunState

getReportTypeMap

public java.util.Map getReportTypeMap()
Get a map of all registered report types

Specified by:
getReportTypeMap in interface RunState

addMessageWithHref

public void addMessageWithHref(java.lang.String message,
                               java.lang.String href)
Write a message node to output element report file, optionally with a url

Specified by:
addMessageWithHref in interface RunState

addMessage

public void addMessage(java.lang.String message,
                       java.lang.String href,
                       java.lang.String reportType)
Description copied from interface: RunState
Add an output message

Specified by:
addMessage in interface RunState

addMessage

public void addMessage(java.lang.String message,
                       java.lang.String code)
Description copied from interface: RunState
Add an output message

Specified by:
addMessage in interface RunState

incrementResultType

public void incrementResultType(java.lang.String reportType)

setPrivateProperty

public void setPrivateProperty(java.lang.String property,
                               java.lang.Object value)
Set a property in the tag's private area. will not be available to other tags using getProperty, or the expression evaluator

Specified by:
setPrivateProperty in interface RunState

getPrivateProperty

public java.lang.Object getPrivateProperty(java.lang.String property)
Get a property in the tag's private area.

Specified by:
getPrivateProperty in interface RunState