|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Method Summary | |
void |
addSubExpression(java.lang.Object object)
Adds the supplied object as a child of this expression. |
void |
clearCache()
Clears any cached results to force re-evaluation. |
java.lang.Object |
clone()
Returns a clone of this. |
java.lang.Object |
getCachedValue()
Returns the cached value for this expression, if the cache is enabled for this expression. |
java.lang.Class[] |
getParameterSignature()
Returns the parameter signature for this Expression . |
Expression |
getParent()
Returns the parent of this expression. |
java.lang.Object |
getSubExpression(int index)
Returns the sub-expression (child) at the specified position. |
int |
getSubExpressionCount()
Returns the number of sub-expressions (children of this expression). |
boolean |
isCached()
Returns true if this expression has
a cached value. |
boolean |
isCacheEnabled()
Returns true if this Expression is caching
the result of evaluating this. |
void |
removeAllSubExpressions()
Removes all the sub-expressions (children) of this. |
java.lang.Object |
removeSubExpression(int index)
Removes the (child) sub-expression at the specified position. |
boolean |
removeSubExpression(java.lang.Object object)
Removes the supplied (child) sub-expression. |
void |
setCachedValue(java.lang.Object obj)
Sets the given object that is the result of evaluating this expression as the cached result value for this expression. |
void |
setCacheEnabled(boolean enable)
Enables the result caching for this Expression . |
void |
setSubExpression(int index,
java.lang.Object object)
Replaces the sub-expression (child) at the specified position. |
void |
write(java.io.PrintStream out)
Writes the expression (in text form) to an OutputStream. |
Method Detail |
public Expression getParent()
public java.lang.Object getSubExpression(int index)
index
- The index of the sub-expression (child) to return.public void setSubExpression(int index, java.lang.Object object)
Note: If the given object (child) is an expression then it is
replaced by null
in the previous parent's children list.
index
- The index of the (child) sub-expression to replace.object
- The new sub-expression (child) to be stored at the specified
position.public java.lang.Object removeSubExpression(int index)
index
- The index of the (child) sub-expression to remove.public boolean removeSubExpression(java.lang.Object object)
object
- The (child) sub-expression to remove.true
If the (child) sub-expression is removed
successfully, otherwise false
.public void removeAllSubExpressions()
public int getSubExpressionCount()
public void addSubExpression(java.lang.Object object)
Expression
and if it already has a parent, then a proxy expression
will be created and added as a child of this expression.
object
- The object added as a child of this.ProxyExpression
public java.lang.Class[] getParameterSignature()
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 java.lang.Object getCachedValue()
isCached()
public void setCachedValue(java.lang.Object obj)
obj
- the value to be cachedisCached()
public boolean isCached()
true
if this expression has
a cached value.
true
If this expression has a cached value, otherwise
false
.public void setCacheEnabled(boolean enable)
Expression
.
enable
- true
to enable the result caching.public void clearCache()
Expression
to be re-evaluated.
public boolean isCacheEnabled()
Expression
is caching
the result of evaluating this.
true
if caching is enabled otherwise false
.public void write(java.io.PrintStream out)
out
- A PrintStream
.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneNotSupportedException
if unable to clone this.
|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |