|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.expression.common.ExpressionUtils
public abstract class ExpressionUtils
Common utility functions that may be used by any Expression Language provider.
Constructor Summary | |
---|---|
ExpressionUtils()
|
Method Summary | ||
---|---|---|
static
|
convert(EvaluationContext context,
Object value,
Class<T> targetType)
Determines if there is a type converter available in the specified context and attempts to use it to convert the supplied value to the specified type. |
|
static
|
convertTypedValue(EvaluationContext context,
TypedValue typedValue,
Class<T> targetType)
Determines if there is a type converter available in the specified context and attempts to use it to convert the supplied value to the specified type. |
|
static boolean |
toBoolean(TypeConverter typeConverter,
TypedValue typedValue)
Attempt to convert a typed value to a boolean using the supplied type converter. |
|
static byte |
toByte(TypeConverter typeConverter,
TypedValue typedValue)
Attempt to convert a typed value to a byte using the supplied type converter. |
|
static char |
toChar(TypeConverter typeConverter,
TypedValue typedValue)
Attempt to convert a typed value to a char using the supplied type converter. |
|
static double |
toDouble(TypeConverter typeConverter,
TypedValue typedValue)
Attempt to convert a typed value to a double using the supplied type converter. |
|
static float |
toFloat(TypeConverter typeConverter,
TypedValue typedValue)
Attempt to convert a typed value to a float using the supplied type converter. |
|
static int |
toInt(TypeConverter typeConverter,
TypedValue typedValue)
Attempt to convert a typed value to an int using the supplied type converter. |
|
static long |
toLong(TypeConverter typeConverter,
TypedValue typedValue)
Attempt to convert a typed value to a long using the supplied type converter. |
|
static short |
toShort(TypeConverter typeConverter,
TypedValue typedValue)
Attempt to convert a typed value to a short using the supplied type converter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExpressionUtils()
Method Detail |
---|
public static <T> T convert(EvaluationContext context, Object value, Class<T> targetType) throws EvaluationException
context
- the evaluation context that may define a type convertervalue
- the value to convert (may be null)targetType
- the type to attempt conversion to
EvaluationException
- if there is a problem during conversion or conversion of the value to the specified
type is not supportedpublic static <T> T convertTypedValue(EvaluationContext context, TypedValue typedValue, Class<T> targetType)
context
- the evaluation context that may define a type convertertypedValue
- the value to convert and a type descriptor describing ittargetType
- the type to attempt conversion to
EvaluationException
- if there is a problem during conversion or conversion of the value to the specified
type is not supportedpublic static int toInt(TypeConverter typeConverter, TypedValue typedValue)
public static boolean toBoolean(TypeConverter typeConverter, TypedValue typedValue)
public static double toDouble(TypeConverter typeConverter, TypedValue typedValue)
public static long toLong(TypeConverter typeConverter, TypedValue typedValue)
public static char toChar(TypeConverter typeConverter, TypedValue typedValue)
public static short toShort(TypeConverter typeConverter, TypedValue typedValue)
public static float toFloat(TypeConverter typeConverter, TypedValue typedValue)
public static byte toByte(TypeConverter typeConverter, TypedValue typedValue)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |