org.loom.converter
Class NullConverter
java.lang.Object
org.loom.converter.AbstractConverter
org.loom.converter.NullConverter
- All Implemented Interfaces:
- Converter, LocaleUnawareConverter, FormInputDecorator
public class NullConverter
- extends AbstractConverter
- implements LocaleUnawareConverter
Class used as a null substitute.
It is used in annotations to indicate that a property hasn't specified
a concrete converter, and at runtime to mark properties that may be
accessed but not converted (for example, validation method containers)
TODO This class should be removed in the future
|
Method Summary |
java.lang.Object |
getAsObject(java.lang.String text)
Perform the conversion. |
java.lang.Object |
getAsObject(java.lang.String name,
java.lang.String value,
Messages messages,
MessagesRepository repository)
Return the object value for the given text |
java.lang.String |
getAsText(java.lang.Object value,
MessagesRepository repository)
Return the text value for the given object |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NullConverter
public NullConverter(PropertyWrapper propertyWrapper)
getAsObject
public java.lang.Object getAsObject(java.lang.String name,
java.lang.String value,
Messages messages,
MessagesRepository repository)
- Description copied from interface:
Converter
- Return the object value for the given text
- Specified by:
getAsObject in interface Converter
value - the value that is being parsed
- Returns:
- the parsed value (can be null), maybe ading new values to the errors array
getAsText
public java.lang.String getAsText(java.lang.Object value,
MessagesRepository repository)
- Description copied from interface:
Converter
- Return the text value for the given object
- Specified by:
getAsText in interface Converter
- Parameters:
value - the java object to convert to textrepository - the MessagesRepository object
- Returns:
- the parsed value (can be null)
getAsObject
public java.lang.Object getAsObject(java.lang.String text)
- Description copied from interface:
LocaleUnawareConverter
- Perform the conversion. If the input data is not valid, will throw a RuntimeException.
- Specified by:
getAsObject in interface LocaleUnawareConverter