Cloneable
, Serializable
An interface implemented by all simple and complex expressions. An expression is a runtime interpreted well formed piece of simple Java code ( all kinds of expressions, conditional statements, etc ). Expression objects can contain sub-expressions, sub-expressions can also be Java literals(Double, Float, Integer, etc). Expressions maintain parent information, children information, internal cache and a parameter signature.
ComplexExpressionImpl
Cloneable
, Serializable
ProxyExpression
Method Summary |
public void |
|
public void |
|
public |
|
public |
|
public |
|
public |
|
public |
|
public int |
|
public boolean |
|
public boolean |
|
public void |
|
public |
|
public boolean |
|
public void |
|
public void |
|
public void |
|
public void |
|
Method Detail |
public void addSubExpression(Object
object)
Adds the supplied object as a child of this expression. If the supplied object is
an instance of Expression
and if it already has a parent, then a proxy expression
will be created and added as a child of this expression.
Related Topics
public void clearCache()Clears any cached results to force re-evaluation. Should also call clearCache on any parent-expressions to force this
Expression
to be re-evaluated.
publicReturns a clone of this.Object
clone()
throwsCloneNotSupportedException
CloneNotSupportedException
public Object
getCachedValue()
Returns the cached value for this expression, if the cache is enabled for this expression.
Related Topics
public Class
[] getParameterSignature()
Returns the parameter signature for this Expression
.
Because the sub-expressions within the Expression
are
typically arguments or operands, some type validation is performed
by examining the class types of the sub-expressions against the
Expression
's parameter signature.
public Expression
getParent()
Returns the parent of this expression.
public Object
getSubExpression(int index)
Returns the sub-expression (child) at the specified position.
public int getSubExpressionCount()Returns the number of sub-expressions (children of this expression).
public boolean isCached()Returns
true
if this expression has
a cached value.
true
If this expression has a cached value, otherwise
false
. public boolean isCacheEnabled()Returns true if this
Expression
is caching
the result of evaluating this.
true
if caching is enabled otherwise false
. public void removeAllSubExpressions()Removes all the sub-expressions (children) of this.
public Object
removeSubExpression(int index)
Removes the (child) sub-expression at the specified position.
public boolean removeSubExpression(Object
object)
Removes the supplied (child) sub-expression.
true
If the (child) sub-expression is removed
successfully, otherwise false
.
public void setCachedValue(Object
obj)
Sets the given object that is the result of evaluating this expression
as the cached result value for this expression.
The evaluate method will return the cached value if
isCached() method returns true.
Related Topics
public void setCacheEnabled(boolean enable)Enables the result caching for this
Expression
.
true
to enable the result caching.
public void setSubExpression(int index,
Object
object)
Replaces the sub-expression (child) at the specified position.
Note: If the given object (child) is an expression then it is
replaced by null
in the previous parent's children list.
public void write(PrintStream
out)
Writes the expression (in text form) to an OutputStream.
PrintStream
.