org.loom.converter
Class AbstractSimpleConverter

java.lang.Object
  extended by org.loom.converter.AbstractConverter
      extended by org.loom.converter.AbstractStringConverter
          extended by org.loom.converter.AbstractSimpleConverter
All Implemented Interfaces:
Converter, LocaleUnawareConverter, FormInputDecorator
Direct Known Subclasses:
BooleanConverter, CharacterConverter, EnumConverter, StringConverter

public abstract class AbstractSimpleConverter
extends AbstractStringConverter
implements LocaleUnawareConverter

Default implementation of a Converter that returns a locale-independant conversion that may never produce a conversion error.


Field Summary
 
Fields inherited from class org.loom.converter.AbstractConverter
convertedClass, cssClass
 
Constructor Summary
protected AbstractSimpleConverter(java.lang.Class<?> convertedClass)
           
 
Method Summary
abstract  java.lang.Object getAsObject(java.lang.String text)
          Perform the conversion.
 java.lang.Object getAsObjectImpl(java.lang.String name, java.lang.String value, Messages messages, MessagesRepository repository)
          This method is the getAsObject implementation, and has the guarantee that the value is not null
 
Methods inherited from class org.loom.converter.AbstractStringConverter
getAsObject, getAsText, getAsTextImpl, getNullValue, setNullValue
 
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
getAsObject, getAsText, getConvertedClass
 
Methods inherited from interface org.loom.validator.FormInputDecorator
decorate
 

Constructor Detail

AbstractSimpleConverter

protected AbstractSimpleConverter(java.lang.Class<?> convertedClass)
Method Detail

getAsObjectImpl

public java.lang.Object getAsObjectImpl(java.lang.String name,
                                        java.lang.String value,
                                        Messages messages,
                                        MessagesRepository repository)
Description copied from class: AbstractStringConverter
This method is the getAsObject implementation, and has the guarantee that the value is not null

Specified by:
getAsObjectImpl in class AbstractStringConverter

getAsObject

public abstract 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