| java.lang.Object com.ivata.mask.field.FieldValueConvertor
All known Subclasses: com.ivata.mask.field.date.DateFieldValueConvertor, com.ivata.mask.field.number.NumberFieldValueConvertor, com.ivata.mask.field.ClassFieldValueConvertor, com.ivata.mask.field.valueobject.ValueObjectFieldValueConvertor, com.ivata.mask.field.date.TimestampFieldValueConvertor,
FieldValueConvertor | public class FieldValueConvertor implements Serializable(Code) | |
Retrieve the value from a value object for a given field.
since: ivata masks 0.1 (2004-05-14) author: Colin MacLeod author: colin.macleod@ivata.com version: $Revision: 1.12 $ |
Method Summary | |
public Object | convertFromString(Class propertyClassParam, String stringValueParam)
Convert a value from a string. | final protected Object | getObjectValue(Object object, String propertyName, Object defaultValue)
Get the value of a named property within an object.
Parameters: object - POJO for which to return the field value. Parameters: propertyName - name of the property/field to return the value for. Parameters: defaultValue - value to use if none is set. | final public String | getStringValue(Object object, String propertyName, String defaultValue)
Get the value of the field provided, in the value object supplied, and
return the string equivalent.
Parameters: object - POJO for which to return the field value. Parameters: propertyName - name of the property/field to return the value for. Parameters: defaultValue - value to use if none is set. | final public ValidationErrors | setStringValue(Object object, Field field, 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.
Parameters: object - POJO for which to set the field value. Parameters: field - field to be set. Parameters: stringValue - new string equivalent value of this field. | protected String | toString(Object objectValue)
Convert a field object value into a string. |
convertFromString | public Object convertFromString(Class propertyClassParam, String stringValueParam)(Code) | |
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.
Parameters: propertyClassParam - exact class to be converted to. Parameters: stringValueParam - value to be converted. valid object value converted from a string. |
getObjectValue | final protected Object getObjectValue(Object object, String propertyName, Object defaultValue)(Code) | |
Get the value of a named property within an object.
Parameters: object - POJO for which to return the field value. Parameters: propertyName - name of the property/field to return the value for. Parameters: defaultValue - value to use if none is set. the value of the named property. |
getStringValue | final public String getStringValue(Object object, String propertyName, String defaultValue)(Code) | |
Get the value of the field provided, in the value object supplied, and
return the string equivalent.
Parameters: object - POJO for which to return the field value. Parameters: propertyName - name of the property/field to return the value for. Parameters: defaultValue - value to use if none is set. the value of the named property, as a string. |
setStringValue | final public ValidationErrors setStringValue(Object object, Field field, String stringValue)(Code) | |
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.
Parameters: object - POJO for which to set the field value. Parameters: field - field to be set. Parameters: stringValue - new string equivalent value of this field. errors, if there are any errors with the field values, otherwisean empty collection. |
toString | protected String toString(Object objectValue)(Code) | |
Convert a field object value into a string. Override this method to
convert for a specific type.
Parameters: objectValue - object to be converted. string equivalent. |
|
|