org.jicengine.element
Class StaticValueElement

java.lang.Object
  extended byorg.jicengine.element.AbstractElement
      extended byorg.jicengine.element.StaticValueElement
All Implemented Interfaces:
Element, ValueElement

public class StaticValueElement
extends AbstractElement
implements ValueElement

Author:
.timo

Field Summary
 
Fields inherited from interface org.jicengine.element.Element
VARIABLE_NAME_CDATA, VARIABLE_NAME_ELEMENT_INSTANCE, VARIABLE_NAME_PARENT_INSTANCE
 
Constructor Summary
StaticValueElement(java.lang.String name, Location location, java.lang.Object value)
           
 
Method Summary
 java.lang.Object getValue(Context context, java.lang.Object parentInstance)
           Creates and returns the value of this element.
 
Methods inherited from class org.jicengine.element.AbstractElement
getLocation, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jicengine.element.Element
getName
 

Constructor Detail

StaticValueElement

public StaticValueElement(java.lang.String name,
                          Location location,
                          java.lang.Object value)
Method Detail

getValue

public java.lang.Object getValue(Context context,
                                 java.lang.Object parentInstance)
Description copied from interface: ValueElement

Creates and returns the value of this element.

The client/user of this element will call this method. currently, the method is called only once. No caching of the result is needed. However, the object should be able to be executed multiple times.

in general, the creation of the value consists of the following steps:

  1. the instance of the element is created first (with parameters)
  2. if the element has other ActionElements as children, they are executed next
  3. the instance is returned.

Specified by:
getValue in interface ValueElement
Parameters:
context - a Context where the instances marked with the 'id'-attribute are put.
parentInstance - the instance of the parent element. NOTE: null-value means that the value of the parent is not available (not yet or never), not that the instance of the parent is null!
Returns:
the value of the element. the operation can return null! (although that is not currently supported by other parts of the framework)