|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ivata.mask.field.FieldValueConvertor
Retrieve the value from a value object for a given field.
| Nested Class Summary | |
static class |
FieldValueConvertor.FieldValueException
Wraps any error encountered when trying retrieve a field value via reflection. |
| Constructor Summary | |
FieldValueConvertor()
|
|
| Method Summary | |
java.lang.Object |
convertFromString(java.lang.Class propertyClassParam,
java.lang.String stringValue)
Convert a value from a string. |
protected java.lang.Object |
getObjectValue(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object defaultValue)
Get the value of a named property within an object. |
java.lang.String |
getStringValue(java.lang.Object object,
java.lang.String propertyName,
java.lang.String defaultValue)
Get the value of the field provided, in the value object supplied, and return the string equivalent. |
ValidationErrors |
setStringValue(java.lang.Object object,
Field field,
java.lang.String stringValue)
Set the value of the field provided, in the value object supplied. |
protected java.lang.String |
toString(java.lang.Object objectValue)
Convert a field object value into a string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FieldValueConvertor()
| Method Detail |
public java.lang.Object convertFromString(java.lang.Class propertyClassParam,
java.lang.String stringValue)
Convert a value from a string. Override this method to choose how your class converts string values to your object class values.
This implementation attempts to instantiate an object of the desired class by locating a constructor which takes a single string as an argument.
propertyClassParam - exact class to be converted to.stringValue - value to be converted.
protected final java.lang.Object getObjectValue(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object defaultValue)
Get the value of a named property within an object.
object - POJO for which to return the field value.propertyName - name of the property/field to return the value for.defaultValue - value to use if none is set.
public final java.lang.String getStringValue(java.lang.Object object,
java.lang.String propertyName,
java.lang.String defaultValue)
Get the value of the field provided, in the value object supplied, and return the string equivalent.
object - POJO for which to return the field value.propertyName - name of the property/field to return the value for.defaultValue - value to use if none is set.
public final ValidationErrors setStringValue(java.lang.Object object,
Field field,
java.lang.String stringValue)
Set the value of the field provided, in the value object supplied.
This implementation attempts to instantiate an object of the desired class by locating a constructor which takes a single string as an argument.
object - POJO for which to set the field value.field - field to be set.stringValue - new string equivalent value of this field.
protected java.lang.String toString(java.lang.Object objectValue)
Convert a field object value into a string. Override this method to convert for a specific type.
objectValue - object to be converted.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||