org.activiti.engine.impl.juel
类 TreeValueExpression

java.lang.Object
  继承者 org.activiti.engine.impl.javax.el.Expression
      继承者 org.activiti.engine.impl.javax.el.ValueExpression
          继承者 org.activiti.engine.impl.juel.TreeValueExpression
所有已实现的接口:
Serializable

public final class TreeValueExpression
extends ValueExpression

A value expression is ready to be evaluated (by calling either getType(ELContext), getValue(ELContext), isReadOnly(ELContext) or setValue(ELContext, Object). Instances of this class are usually created using an ExpressionFactoryImpl.

作者:
Christoph Beck
另请参见:
序列化表格

构造方法摘要
TreeValueExpression(TreeStore store, FunctionMapper functions, VariableMapper variables, TypeConverter converter, String expr, Class<?> type)
          Create a new value expression.
 
方法摘要
 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()
          Returns the type the result of the expression will be coerced to after evaluation.
 String getExpressionString()
          Returns the original String used to create this Expression, unmodified.
 Class<?> getType(ELContext context)
          Evaluates the expression as an lvalue and answers the result type.
 Object getValue(ELContext context)
          Evaluates the expression as an rvalue and answers the result.
 ValueReference getValueReference(ELContext context)
          Returns a ValueReference for this expression instance.
 int hashCode()
          Returns the hash code for this Expression.
 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()
          Returns whether this expression was created from only literal text.
 boolean isReadOnly(ELContext context)
          Evaluates the expression as an lvalue and determines if setValue(ELContext, Object) will always fail.
 void setValue(ELContext context, Object value)
          Evaluates the expression as an lvalue and assigns the given value.
 String toString()
           
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

TreeValueExpression

public TreeValueExpression(TreeStore store,
                           FunctionMapper functions,
                           VariableMapper variables,
                           TypeConverter converter,
                           String expr,
                           Class<?> type)
Create a new value expression.

参数:
store - used to get the parse tree from.
functions - the function mapper used to bind functions
variables - the variable mapper used to bind variables
expr - the expression string
type - the expected type (may be null)
方法详细信息

getExpectedType

public Class<?> getExpectedType()
从类 ValueExpression 复制的描述
Returns the type the result of the expression will be coerced to after evaluation.

指定者:
ValueExpression 中的 getExpectedType
返回:
the expectedType passed to the ExpressionFactory.createValueExpression method that created this ValueExpression.

getExpressionString

public String getExpressionString()
从类 Expression 复制的描述
Returns the original String used to create this Expression, unmodified. This is used for debugging purposes but also for the purposes of comparison (e.g. to ensure the expression in a configuration file has not changed). This method does not provide sufficient information to re-create an expression. Two different expressions can have exactly the same expression string but different function mappings. Serialization should be used to save and restore the state of an Expression.

指定者:
Expression 中的 getExpressionString
返回:
The original expression String.

getType

public Class<?> getType(ELContext context)
                 throws ELException
Evaluates the expression as an lvalue and answers the result type.

指定者:
ValueExpression 中的 getType
参数:
context - used to resolve properties (base.property and base[property]) and to determine the result from the last base/property pair
返回:
lvalue evaluation type or null for rvalue expressions
抛出:
ELException - if evaluation fails (e.g. property not found, type conversion failed, ...)

getValue

public Object getValue(ELContext context)
                throws ELException
Evaluates the expression as an rvalue and answers the result.

指定者:
ValueExpression 中的 getValue
参数:
context - used to resolve properties (base.property and base[property]) and to determine the result from the last base/property pair
返回:
rvalue evaluation result
抛出:
ELException - if evaluation fails (e.g. property not found, type conversion failed, ...)

isReadOnly

public boolean isReadOnly(ELContext context)
                   throws ELException
Evaluates the expression as an lvalue and determines if setValue(ELContext, Object) will always fail.

指定者:
ValueExpression 中的 isReadOnly
参数:
context - used to resolve properties (base.property and base[property]) and to determine the result from the last base/property pair
返回:
true if setValue(ELContext, Object) always fails.
抛出:
ELException - if evaluation fails (e.g. property not found, type conversion failed, ...)

setValue

public void setValue(ELContext context,
                     Object value)
              throws ELException
Evaluates the expression as an lvalue and assigns the given value.

指定者:
ValueExpression 中的 setValue
参数:
context - used to resolve properties (base.property and base[property]) and to perform the assignment to the last base/property pair
value - The new value to be set.
抛出:
ELException - if evaluation fails (e.g. property not found, type conversion failed, assignment failed...)

isLiteralText

public boolean isLiteralText()
从类 Expression 复制的描述
Returns whether this expression was created from only literal text. This method must return true if and only if the expression string this expression was created from contained no unescaped EL delimeters (${...} or #{...}).

指定者:
Expression 中的 isLiteralText
返回:
true if this is a literal text expression

getValueReference

public ValueReference getValueReference(ELContext context)
从类 ValueExpression 复制的描述
Returns a ValueReference for this expression instance.

覆盖:
ValueExpression 中的 getValueReference
参数:
context - the context of this evaluation
返回:
the ValueReference for this ValueExpression, or null if this ValueExpression is not a reference to a base (null or non-null) and a property. If the base is null, and the property is a EL variable, return the ValueReference for the ValueExpression associated with this EL variable.

isLeftValue

public boolean isLeftValue()
Answer 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 [])


isDeferred

public boolean isDeferred()
Answer true if this is a deferred expression (containing sub-expressions starting with #{)


equals

public 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. Two value expressions are equal if
  1. their structural id's are equal
  2. their bindings are equal
  3. their expected types are equal

指定者:
Expression 中的 equals
参数:
obj - the Object to test for equality.
返回:
true if obj equals this Expression; false otherwise.

hashCode

public int hashCode()
从类 Expression 复制的描述
Returns the hash code for this Expression. See the note in the Expression.equals(Object) method on how two expressions can be equal if their expression Strings are different. Recall that if two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. Implementations must take special note and implement hashCode correctly.

指定者:
Expression 中的 hashCode
返回:
The hash code for this Expression.
另请参见:
Expression.equals(Object), Hashtable, Object.hashCode()

toString

public String toString()
覆盖:
Object 中的 toString

dump

public void dump(PrintWriter writer)
Print the parse tree.

参数:
writer -


Copyright © 2013 Alfresco. All rights reserved.