public abstract class ValueTransformer<T>
extends java.lang.Object
A value transformer is an object that takes an instance of some object and returns a new object of the same class with the input object's value transformed in some way from the original. An example of this might be a class to convert temperatures from Fahrenheit to Centigrade.
Constructor and Description |
---|
ValueTransformer() |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsReverseTransformation()
Returns true if the instance can do a reverse transformation.
|
T |
reverseTransformValue(T o)
Performs a reverse transformation.
|
abstract T |
transformValue(T o)
Transforms an object's value.
|
public boolean allowsReverseTransformation()
false
.true
if a reverse transformation is
supported; false
if it is notpublic T reverseTransformValue(T o)
UnsupportedOperationException
unless the child class overrides
allowsReverseTransformation
to return
true
. If such a child does not also override
reverseTransformValue
, the default performs
transformValue
.o
- the instance object to reverse transformjava.lang.UnsupportedOperationException
- when a reverse
transformation is not supported