public interface

Expression

org.springframework.expression.Expression
Known Indirect Subclasses

Class Overview

An expression capable of evaluating itself against context objects. Encapsulates the details of a previously parsed expression string. Provides a common abstraction for expression evaluation independent of any language like OGNL or the Unified EL.

Summary

Public Methods
abstract String getExpressionString()
Returns the original string used to create this expression, unmodified.
abstract Object getValue(Object rootObject)
Evaluate this expression against the specified root object
abstract <T> T getValue(Object rootObject, Class<T> desiredResultType)
Evaluate the expression in the default context against the specified root object.
abstract Object getValue()
Evaluate this expression in the default standard context.
abstract <T> T getValue(Class<T> desiredResultType)
Evaluate the expression in the default context.
abstract Object 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.
abstract <T> T getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType)
Evaluate 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.
abstract Object getValue(EvaluationContext context)
Evaluate this expression in the provided context and return the result of evaluation.
abstract <T> T getValue(EvaluationContext context, Class<T> desiredResultType)
Evaluate 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.
abstract Class getValueType(Object rootObject)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.
abstract Class getValueType(EvaluationContext context, Object rootObject)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.
abstract Class getValueType()
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.
abstract Class getValueType(EvaluationContext context)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.
abstract TypeDescriptor getValueTypeDescriptor(EvaluationContext context, Object rootObject)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.
abstract TypeDescriptor getValueTypeDescriptor()
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.
abstract TypeDescriptor getValueTypeDescriptor(EvaluationContext context)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.
abstract TypeDescriptor getValueTypeDescriptor(Object rootObject)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.
abstract boolean isWritable(Object rootObject)
Determine if an expression can be written to, i.e.
abstract boolean isWritable(EvaluationContext context)
Determine if an expression can be written to, i.e.
abstract boolean isWritable(EvaluationContext context, Object rootObject)
Determine if an expression can be written to, i.e.
abstract void setValue(EvaluationContext context, Object value)
Set this expression in the provided context to the value provided.
abstract void setValue(EvaluationContext context, Object rootObject, Object value)
Set this expression in the provided context to the value provided.
abstract void setValue(Object rootObject, Object value)
Set this expression in the provided context to the value provided.

Public Methods

public abstract String getExpressionString ()

Returns the original string used to create this expression, unmodified.

Returns
  • the original expression string

public abstract Object getValue (Object rootObject)

Evaluate this expression against the specified root object

Parameters
rootObject the root object against which properties/etc will be resolved
Returns
  • the evaluation result
Throws
EvaluationException if there is a problem during evaluation

public abstract T getValue (Object rootObject, Class<T> desiredResultType)

Evaluate 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.

Parameters
rootObject the root object against which properties/etc will be resolved
desiredResultType the class the caller would like the result to be
Returns
  • the evaluation result
Throws
EvaluationException if there is a problem during evaluation

public abstract Object getValue ()

Evaluate this expression in the default standard context.

Returns
  • the evaluation result
Throws
EvaluationException if there is a problem during evaluation

public abstract T getValue (Class<T> desiredResultType)

Evaluate 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.

Parameters
desiredResultType the class the caller would like the result to be
Returns
  • the evaluation result
Throws
EvaluationException if there is a problem during evaluation

public abstract Object 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.

Parameters
context the context in which to evaluate the expression
rootObject the root object against which properties/etc will be resolved
Returns
  • the evaluation result
Throws
EvaluationException if there is a problem during evaluation

public abstract T getValue (EvaluationContext context, Object rootObject, Class<T> desiredResultType)

Evaluate 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.

Parameters
context the context in which to evaluate the expression
rootObject the root object against which properties/etc will be resolved
desiredResultType the class the caller would like the result to be
Returns
  • the evaluation result
Throws
EvaluationException if there is a problem during evaluation

public abstract Object getValue (EvaluationContext context)

Evaluate this expression in the provided context and return the result of evaluation.

Parameters
context the context in which to evaluate the expression
Returns
  • the evaluation result
Throws
EvaluationException if there is a problem during evaluation

public abstract T getValue (EvaluationContext context, Class<T> desiredResultType)

Evaluate 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.

Parameters
context the context in which to evaluate the expression
desiredResultType the class the caller would like the result to be
Returns
  • the evaluation result
Throws
EvaluationException if there is a problem during evaluation

public abstract Class getValueType (Object rootObject)

Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.

Parameters
rootObject the root object against which to evaluate the expression
Returns
  • the most general type of value that can be set on this context
Throws
EvaluationException if there is a problem determining the type

public abstract Class getValueType (EvaluationContext context, Object rootObject)

Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context. The supplied root object overrides any specified in the context.

Parameters
context the context in which to evaluate the expression
rootObject the root object against which to evaluate the expression
Returns
  • the most general type of value that can be set on this context
Throws
EvaluationException if there is a problem determining the type

public abstract Class getValueType ()

Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.

Returns
  • the most general type of value that can be set on this context
Throws
EvaluationException if there is a problem determining the type

public abstract Class getValueType (EvaluationContext context)

Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.

Parameters
context the context in which to evaluate the expression
Returns
  • the most general type of value that can be set on this context
Throws
EvaluationException if there is a problem determining the type

public abstract TypeDescriptor getValueTypeDescriptor (EvaluationContext context, Object rootObject)

Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context. The supplied root object overrides any specified in the context.

Parameters
context the context in which to evaluate the expression
rootObject the root object against which to evaluate the expression
Returns
  • a type descriptor for the most general type of value that can be set on this context
Throws
EvaluationException if there is a problem determining the type

public abstract TypeDescriptor getValueTypeDescriptor ()

Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.

Returns
  • a type descriptor for the most general type of value that can be set on this context
Throws
EvaluationException if there is a problem determining the type

public abstract TypeDescriptor getValueTypeDescriptor (EvaluationContext context)

Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.

Parameters
context the context in which to evaluate the expression
Returns
  • a type descriptor for the most general type of value that can be set on this context
Throws
EvaluationException if there is a problem determining the type

public abstract TypeDescriptor getValueTypeDescriptor (Object rootObject)

Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.

Parameters
rootObject the root object against which to evaluate the expression
Returns
  • a type descriptor for the most general type of value that can be set on this context
Throws
EvaluationException if there is a problem determining the type

public abstract boolean isWritable (Object rootObject)

Determine if an expression can be written to, i.e. setValue() can be called.

Parameters
rootObject the root object against which to evaluate the expression
Returns
  • true if the expression is writable
Throws
EvaluationException if there is a problem determining if it is writable

public abstract boolean isWritable (EvaluationContext context)

Determine if an expression can be written to, i.e. setValue() can be called.

Parameters
context the context in which the expression should be checked
Returns
  • true if the expression is writable
Throws
EvaluationException if there is a problem determining if it is writable

public abstract boolean isWritable (EvaluationContext context, Object rootObject)

Determine if an expression can be written to, i.e. setValue() can be called. The supplied root object overrides any specified in the context.

Parameters
context the context in which the expression should be checked
rootObject the root object against which to evaluate the expression
Returns
  • true if the expression is writable
Throws
EvaluationException if there is a problem determining if it is writable

public abstract void setValue (EvaluationContext context, Object value)

Set this expression in the provided context to the value provided.

Parameters
context the context in which to set the value of the expression
value the new value
Throws
EvaluationException if there is a problem during evaluation

public abstract void setValue (EvaluationContext context, Object rootObject, Object value)

Set this expression in the provided context to the value provided. The supplied root object overrides any specified in the context.

Parameters
context the context in which to set the value of the expression
rootObject the root object against which to evaluate the expression
value the new value
Throws
EvaluationException if there is a problem during evaluation

public abstract void setValue (Object rootObject, Object value)

Set this expression in the provided context to the value provided.

Parameters
rootObject the root object against which to evaluate the expression
value the new value
Throws
EvaluationException if there is a problem during evaluation