org.loom.converter
Class AbstractFormatConverter

java.lang.Object
  extended by org.loom.converter.AbstractConverter
      extended by org.loom.converter.AbstractStringConverter
          extended by org.loom.converter.AbstractFormatConverter
All Implemented Interfaces:
Converter, FormInputDecorator
Direct Known Subclasses:
AbstractDecimalConverter, DateConverter, MinutesConverter

public abstract class AbstractFormatConverter
extends AbstractStringConverter

Converter that is based in a Format


Field Summary
 
Fields inherited from class org.loom.converter.AbstractConverter
convertedClass, cssClass
 
Constructor Summary
AbstractFormatConverter(java.lang.Class<?> convertedClass, java.lang.String formatKey)
           
AbstractFormatConverter(java.lang.Class<?> convertedClass, java.lang.String formatKey, java.lang.String errorKey)
           
 
Method Summary
protected abstract  java.text.Format createFormat(MessagesRepository messagesRepository)
          Creates a new format instance.
 java.lang.Object getAsObjectImpl(java.lang.String paramName, java.lang.String paramValue, Messages messages, MessagesRepository repository)
          This method is the getAsObject implementation, and has the guarantee that the value is not null
 java.lang.String getAsTextImpl(java.lang.Object value, MessagesRepository repository)
          This method is the getAsText implementation, and has the guarantee that the value is not null
 java.lang.String getFormatKey()
           
protected  java.lang.Object parse(java.lang.String text, java.text.ParsePosition pos, MessagesRepository repository)
           
 
Methods inherited from class org.loom.converter.AbstractStringConverter
getAsObject, getAsText, 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
getConvertedClass
 
Methods inherited from interface org.loom.validator.FormInputDecorator
decorate
 

Constructor Detail

AbstractFormatConverter

public AbstractFormatConverter(java.lang.Class<?> convertedClass,
                               java.lang.String formatKey,
                               java.lang.String errorKey)

AbstractFormatConverter

public AbstractFormatConverter(java.lang.Class<?> convertedClass,
                               java.lang.String formatKey)
Method Detail

getAsObjectImpl

public java.lang.Object getAsObjectImpl(java.lang.String paramName,
                                        java.lang.String paramValue,
                                        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

parse

protected java.lang.Object parse(java.lang.String text,
                                 java.text.ParsePosition pos,
                                 MessagesRepository repository)

getAsTextImpl

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

Overrides:
getAsTextImpl in class AbstractStringConverter

createFormat

protected abstract java.text.Format createFormat(MessagesRepository messagesRepository)
Creates a new format instance. Format instances may be different per locale and will be cached in the MessagesRepository


getFormatKey

public java.lang.String getFormatKey()