public final class TreeValueExpression
extends javax.el.ValueExpression
getType(ELContext)
, getValue(ELContext)
, isReadOnly(ELContext)
or setValue(ELContext, Object)
.
Instances of this class are usually created using an ExpressionFactoryImpl
.Constructor and Description |
---|
TreeValueExpression(TreeStore store,
javax.el.FunctionMapper functions,
javax.el.VariableMapper variables,
TypeConverter converter,
String expr,
Class<?> type)
Create a new value expression.
|
Modifier and Type | Method and Description |
---|---|
void |
dump(PrintWriter writer)
Print the parse tree.
|
boolean |
equals(Object obj)
Expressions are compared using the concept of a structural id:
variable and function names are anonymized such that two expressions with
same tree structure will also have the same structural id and vice versa.
|
Class<?> |
getExpectedType() |
String |
getExpressionString() |
Class<?> |
getType(javax.el.ELContext context)
Evaluates the expression as an lvalue and answers the result type.
|
Object |
getValue(javax.el.ELContext context)
Evaluates the expression as an rvalue and answers the result.
|
javax.el.ValueReference |
getValueReference(javax.el.ELContext context) |
int |
hashCode() |
boolean |
isDeferred()
Answer
true if this is a deferred expression (containing
sub-expressions starting with #{ ) |
boolean |
isLeftValue()
Answer
true if this could be used as an lvalue. |
boolean |
isLiteralText() |
boolean |
isReadOnly(javax.el.ELContext context)
Evaluates the expression as an lvalue and determines if
setValue(ELContext, Object)
will always fail. |
void |
setValue(javax.el.ELContext context,
Object value)
Evaluates the expression as an lvalue and assigns the given value.
|
String |
toString() |
public TreeValueExpression(TreeStore store, javax.el.FunctionMapper functions, javax.el.VariableMapper variables, TypeConverter converter, String expr, Class<?> type)
store
- used to get the parse tree from.functions
- the function mapper used to bind functionsvariables
- the variable mapper used to bind variablesexpr
- the expression stringtype
- the expected type (may be null
)public Class<?> getExpectedType()
getExpectedType
in class javax.el.ValueExpression
public String getExpressionString()
getExpressionString
in class javax.el.Expression
public Class<?> getType(javax.el.ELContext context) throws javax.el.ELException
getType
in class javax.el.ValueExpression
context
- used to resolve properties (base.property
and base[property]
)
and to determine the result from the last base/property pairnull
for rvalue expressionsjavax.el.ELException
- if evaluation fails (e.g. property not found, type conversion failed, ...)public Object getValue(javax.el.ELContext context) throws javax.el.ELException
getValue
in class javax.el.ValueExpression
context
- used to resolve properties (base.property
and base[property]
)
and to determine the result from the last base/property pairjavax.el.ELException
- if evaluation fails (e.g. property not found, type conversion failed, ...)public boolean isReadOnly(javax.el.ELContext context) throws javax.el.ELException
setValue(ELContext, Object)
will always fail.isReadOnly
in class javax.el.ValueExpression
context
- used to resolve properties (base.property
and base[property]
)
and to determine the result from the last base/property pairtrue
if setValue(ELContext, Object)
always fails.javax.el.ELException
- if evaluation fails (e.g. property not found, type conversion failed, ...)public void setValue(javax.el.ELContext context, Object value) throws javax.el.ELException
setValue
in class javax.el.ValueExpression
context
- used to resolve properties (base.property
and base[property]
)
and to perform the assignment to the last base/property pairjavax.el.ELException
- if evaluation fails (e.g. property not found, type conversion failed, assignment failed...)public boolean isLiteralText()
isLiteralText
in class javax.el.Expression
true
if this is a literal text expressionpublic javax.el.ValueReference getValueReference(javax.el.ELContext context)
getValueReference
in class javax.el.ValueExpression
public boolean isLeftValue()
true
if this could be used as an lvalue.
This is the case for eval expressions consisting of a simple identifier or
a nonliteral prefix, followed by a sequence of property operators (.
or []
)public boolean isDeferred()
true
if this is a deferred expression (containing
sub-expressions starting with #{
)public boolean equals(Object obj)
equals
in class javax.el.Expression
public int hashCode()
hashCode
in class javax.el.Expression
public void dump(PrintWriter writer)
writer
- Copyright © 2006–2017 Odysseus Software GmbH. All rights reserved.