类 CompositeStringExpression
java.lang.Object
cn.taketoday.expression.common.CompositeStringExpression
- 所有已实现的接口:
Expression
Represents a template expression broken into pieces. Each piece will be an Expression
but pure text parts to the template will be represented as LiteralExpression objects.
An example of a template expression might be:
"Hello ${getName()}"
which will be represented as a CompositeStringExpression of two parts. The first part
being a LiteralExpression representing 'Hello ' and the second part being a real
expression that will call getName() when invoked.- 从以下版本开始:
- 4.0
- 作者:
- Andy Clement, Juergen Hoeller
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明final Expression[]final StringReturn the original string used to create this expression (unmodified).getValue()Evaluate this expression in the default standard context.getValue(EvaluationContext context) Evaluate this expression in the provided context and return the result of evaluation.<T> TgetValue(EvaluationContext context, Class<T> expectedResultType) Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc.getValue(EvaluationContext context, Object rootObject) Evaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.<T> TgetValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType) Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc.<T> TEvaluate the expression in the default context.Evaluate this expression against the specified root object.<T> TEvaluate the expression in the default context against the specified root object.Class<?>Return the most general type that can be passed to aExpression.setValue(java.lang.Object, java.lang.Object)method using the default context.Class<?>getValueType(EvaluationContext context) Return the most general type that can be passed to theExpression.setValue(EvaluationContext, Object)method for the given context.Class<?>getValueType(EvaluationContext context, Object rootObject) Return the most general type that can be passed to theExpression.setValue(EvaluationContext, Object, Object)method for the given context.Class<?>getValueType(Object rootObject) Return the most general type that can be passed to theExpression.setValue(Object, Object)method using the default context.Return the most general type that can be passed to aExpression.setValue(java.lang.Object, java.lang.Object)method using the default context.getValueTypeDescriptor(EvaluationContext context) Return the most general type that can be passed to theExpression.setValue(EvaluationContext, Object)method for the given context.getValueTypeDescriptor(EvaluationContext context, Object rootObject) Return the most general type that can be passed to theExpression.setValue(EvaluationContext, Object, Object)method for the given context.getValueTypeDescriptor(Object rootObject) Return the most general type that can be passed to theExpression.setValue(Object, Object)method using the default context.booleanisWritable(EvaluationContext context) Determine if an expression can be written to, i.e. setValue() can be called.booleanisWritable(EvaluationContext context, Object rootObject) Determine if an expression can be written to, i.e. setValue() can be called.booleanisWritable(Object rootObject) Determine if an expression can be written to, i.e. setValue() can be called.voidsetValue(EvaluationContext context, Object value) Set this expression in the provided context to the value provided.voidsetValue(EvaluationContext context, Object rootObject, Object value) Set this expression in the provided context to the value provided.voidSet this expression in the provided context to the value provided.
-
构造器详细资料
-
CompositeStringExpression
-
-
方法详细资料
-
getExpressionString
从接口复制的说明:ExpressionReturn the original string used to create this expression (unmodified).- 指定者:
getExpressionString在接口中Expression- 返回:
- the original expression string
-
getExpressions
-
getValue
从接口复制的说明:ExpressionEvaluate this expression in the default standard context.- 指定者:
getValue在接口中Expression- 返回:
- the evaluation result
- 抛出:
EvaluationException- if there is a problem during evaluation
-
getValue
从接口复制的说明:ExpressionEvaluate the expression in the default context. If the result of the evaluation does not match (and cannot be converted to) the expected result type then an exception will be returned.- 指定者:
getValue在接口中Expression- 参数:
expectedResultType- the class the caller would like the result to be- 返回:
- the evaluation result
- 抛出:
EvaluationException- if there is a problem during evaluation
-
getValue
从接口复制的说明:ExpressionEvaluate this expression against the specified root object.- 指定者:
getValue在接口中Expression- 参数:
rootObject- the root object against which to evaluate the expression- 返回:
- the evaluation result
- 抛出:
EvaluationException- if there is a problem during evaluation
-
getValue
@Nullable public <T> T getValue(@Nullable Object rootObject, @Nullable Class<T> desiredResultType) throws EvaluationException 从接口复制的说明:ExpressionEvaluate the expression in the default context against the specified root object. If the result of the evaluation does not match (and cannot be converted to) the expected result type then an exception will be returned.- 指定者:
getValue在接口中Expression- 参数:
rootObject- the root object against which to evaluate the expressiondesiredResultType- the class the caller would like the result to be- 返回:
- the evaluation result
- 抛出:
EvaluationException- if there is a problem during evaluation
-
getValue
从接口复制的说明:ExpressionEvaluate this expression in the provided context and return the result of evaluation.- 指定者:
getValue在接口中Expression- 参数:
context- the context in which to evaluate the expression- 返回:
- the evaluation result
- 抛出:
EvaluationException- if there is a problem during evaluation
-
getValue
@Nullable public <T> T getValue(EvaluationContext context, @Nullable Class<T> expectedResultType) throws EvaluationException 从接口复制的说明:ExpressionEvaluate the expression in a specified context which can resolve references to properties, methods, types, etc. The type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.- 指定者:
getValue在接口中Expression- 参数:
context- the context in which to evaluate the expressionexpectedResultType- the class the caller would like the result to be- 返回:
- the evaluation result
- 抛出:
EvaluationException- if there is a problem during evaluation
-
getValue
public String getValue(EvaluationContext context, @Nullable Object rootObject) throws EvaluationException 从接口复制的说明:ExpressionEvaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.- 指定者:
getValue在接口中Expression- 参数:
context- the context in which to evaluate the expressionrootObject- the root object against which to evaluate the expression- 返回:
- the evaluation result
- 抛出:
EvaluationException- if there is a problem during evaluation
-
getValue
@Nullable public <T> T getValue(EvaluationContext context, @Nullable Object rootObject, @Nullable Class<T> desiredResultType) throws EvaluationException 从接口复制的说明:ExpressionEvaluate the expression in a specified context which can resolve references to properties, methods, types, etc. The type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type. The supplied root object overrides any default specified on the supplied context.- 指定者:
getValue在接口中Expression- 参数:
context- the context in which to evaluate the expressionrootObject- the root object against which to evaluate the expressiondesiredResultType- the class the caller would like the result to be- 返回:
- the evaluation result
- 抛出:
EvaluationException- if there is a problem during evaluation
-
getValueType
从接口复制的说明:ExpressionReturn the most general type that can be passed to aExpression.setValue(java.lang.Object, java.lang.Object)method using the default context.- 指定者:
getValueType在接口中Expression- 返回:
- the most general type of value that can be set on this context
-
getValueType
从接口复制的说明:ExpressionReturn the most general type that can be passed to theExpression.setValue(EvaluationContext, Object)method for the given context.- 指定者:
getValueType在接口中Expression- 参数:
context- the context in which to evaluate the expression- 返回:
- the most general type of value that can be set on this context
-
getValueType
从接口复制的说明:ExpressionReturn the most general type that can be passed to theExpression.setValue(Object, Object)method using the default context.- 指定者:
getValueType在接口中Expression- 参数:
rootObject- the root object against which to evaluate the expression- 返回:
- the most general type of value that can be set on this context
- 抛出:
EvaluationException- if there is a problem determining the type
-
getValueType
public Class<?> getValueType(EvaluationContext context, @Nullable Object rootObject) throws EvaluationException 从接口复制的说明:ExpressionReturn the most general type that can be passed to theExpression.setValue(EvaluationContext, Object, Object)method for the given context. The supplied root object overrides any specified in the context.- 指定者:
getValueType在接口中Expression- 参数:
context- the context in which to evaluate the expressionrootObject- the root object against which to evaluate the expression- 返回:
- the most general type of value that can be set on this context
- 抛出:
EvaluationException- if there is a problem determining the type
-
getValueTypeDescriptor
从接口复制的说明:ExpressionReturn the most general type that can be passed to aExpression.setValue(java.lang.Object, java.lang.Object)method using the default context.- 指定者:
getValueTypeDescriptor在接口中Expression- 返回:
- a type descriptor for values that can be set on this context
-
getValueTypeDescriptor
public TypeDescriptor getValueTypeDescriptor(@Nullable Object rootObject) throws EvaluationException 从接口复制的说明:ExpressionReturn the most general type that can be passed to theExpression.setValue(Object, Object)method using the default context.- 指定者:
getValueTypeDescriptor在接口中Expression- 参数:
rootObject- the root object against which to evaluate the expression- 返回:
- a type descriptor for values that can be set on this context
- 抛出:
EvaluationException- if there is a problem determining the type
-
getValueTypeDescriptor
从接口复制的说明:ExpressionReturn the most general type that can be passed to theExpression.setValue(EvaluationContext, Object)method for the given context.- 指定者:
getValueTypeDescriptor在接口中Expression- 参数:
context- the context in which to evaluate the expression- 返回:
- a type descriptor for values that can be set on this context
-
getValueTypeDescriptor
public TypeDescriptor getValueTypeDescriptor(EvaluationContext context, @Nullable Object rootObject) throws EvaluationException 从接口复制的说明:ExpressionReturn the most general type that can be passed to theExpression.setValue(EvaluationContext, Object, Object)method for the given context. The supplied root object overrides any specified in the context.- 指定者:
getValueTypeDescriptor在接口中Expression- 参数:
context- the context in which to evaluate the expressionrootObject- the root object against which to evaluate the expression- 返回:
- a type descriptor for values that can be set on this context
- 抛出:
EvaluationException- if there is a problem determining the type
-
isWritable
从接口复制的说明:ExpressionDetermine if an expression can be written to, i.e. setValue() can be called.- 指定者:
isWritable在接口中Expression- 参数:
rootObject- the root object against which to evaluate the expression- 返回:
trueif the expression is writable;falseotherwise- 抛出:
EvaluationException- if there is a problem determining if it is writable
-
isWritable
从接口复制的说明:ExpressionDetermine if an expression can be written to, i.e. setValue() can be called.- 指定者:
isWritable在接口中Expression- 参数:
context- the context in which the expression should be checked- 返回:
trueif the expression is writable;falseotherwise
-
isWritable
public boolean isWritable(EvaluationContext context, @Nullable Object rootObject) throws EvaluationException 从接口复制的说明:ExpressionDetermine if an expression can be written to, i.e. setValue() can be called. The supplied root object overrides any specified in the context.- 指定者:
isWritable在接口中Expression- 参数:
context- the context in which the expression should be checkedrootObject- the root object against which to evaluate the expression- 返回:
trueif the expression is writable;falseotherwise- 抛出:
EvaluationException- if there is a problem determining if it is writable
-
setValue
public void setValue(@Nullable Object rootObject, @Nullable Object value) throws EvaluationException 从接口复制的说明:ExpressionSet this expression in the provided context to the value provided.- 指定者:
setValue在接口中Expression- 参数:
rootObject- the root object against which to evaluate the expressionvalue- the new value- 抛出:
EvaluationException- if there is a problem during evaluation
-
setValue
从接口复制的说明:ExpressionSet this expression in the provided context to the value provided.- 指定者:
setValue在接口中Expression- 参数:
context- the context in which to set the value of the expressionvalue- the new value- 抛出:
EvaluationException- if there is a problem during evaluation
-
setValue
public void setValue(EvaluationContext context, @Nullable Object rootObject, @Nullable Object value) throws EvaluationException 从接口复制的说明:ExpressionSet this expression in the provided context to the value provided. The supplied root object overrides any specified in the context.- 指定者:
setValue在接口中Expression- 参数:
context- the context in which to set the value of the expressionrootObject- the root object against which to evaluate the expressionvalue- the new value- 抛出:
EvaluationException- if there is a problem during evaluation
-