org.springframework.expression
Class TypedValue
java.lang.Object
org.springframework.expression.TypedValue
- Direct Known Subclasses:
- BooleanTypedValue
public class TypedValue
- extends java.lang.Object
Encapsulates an object and a type descriptor that describes it.
The type descriptor can hold generic information that would not be
accessible through a simple getClass()
call on the object.
- Since:
- 3.0
- Author:
- Andy Clement, Juergen Hoeller
Constructor Summary |
TypedValue(java.lang.Object value)
Create a TypedValue for a simple object. |
TypedValue(java.lang.Object value,
TypeDescriptor typeDescriptor)
Create a TypedValue for a particular value with a particular type descriptor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NULL
public static final TypedValue NULL
value
private final java.lang.Object value
typeDescriptor
private TypeDescriptor typeDescriptor
TypedValue
public TypedValue(java.lang.Object value)
- Create a TypedValue for a simple object. The type descriptor is inferred
from the object, so no generic information is preserved.
- Parameters:
value
- the object value
TypedValue
public TypedValue(java.lang.Object value,
TypeDescriptor typeDescriptor)
- Create a TypedValue for a particular value with a particular type descriptor.
- Parameters:
value
- the object valuetypeDescriptor
- a type descriptor describing the type of the value
getValue
public java.lang.Object getValue()
getTypeDescriptor
public TypeDescriptor getTypeDescriptor()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object