org.loom.converter
Class NullConverter

java.lang.Object
  extended by org.loom.converter.AbstractConverter
      extended by 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


Field Summary
 
Fields inherited from class org.loom.converter.AbstractConverter
convertedClass, cssClass
 
Constructor Summary
NullConverter(PropertyWrapper propertyWrapper)
           
 
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 org.loom.converter.AbstractConverter
addErrorMessage, decorate, getConvertedClass, getCssClass, setConvertedClass, setCssClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.loom.converter.Converter
getConvertedClass
 
Methods inherited from interface org.loom.validator.FormInputDecorator
decorate
 

Constructor Detail

NullConverter

public NullConverter(PropertyWrapper propertyWrapper)
Method Detail

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 text
repository - 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