org.loom.converter
Class AbstractStringConverter

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

public abstract class AbstractStringConverter
extends AbstractConverter

A class that must be able to perform the conversion from and to a String value.

Author:
Ignacio Coloma

Field Summary
 
Fields inherited from class org.loom.converter.AbstractConverter
convertedClass, cssClass
 
Constructor Summary
protected AbstractStringConverter(java.lang.Class<?> convertedClass)
           
 
Method Summary
 java.lang.Object getAsObject(ParameterValue value, Messages messages, MessagesRepository repository)
          Return the object value for the given text
protected abstract  java.lang.Object getAsObjectImpl(ParameterValue value, Messages messages, MessagesRepository repository)
          This method is the getAsObject implementation, and has the guarantee that the value is not null
 java.lang.String getAsText(java.lang.Object value, MessagesRepository repository)
          Return the text value for the given object
protected  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
 
Methods inherited from class org.loom.converter.AbstractConverter
decorate, getConvertedClass, getCssClass, setConvertedClass, setCssClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStringConverter

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

getAsObject

public final java.lang.Object getAsObject(ParameterValue value,
                                          Messages messages,
                                          MessagesRepository repository)
Return the object value for the given text

Specified by:
getAsObject in interface Converter
Specified by:
getAsObject in class AbstractConverter
Parameters:
value - the value that is being parsed
Returns:
the parsed value (can be null), maybe ading new values to the errors array

getAsObjectImpl

protected abstract java.lang.Object getAsObjectImpl(ParameterValue value,
                                                    Messages messages,
                                                    MessagesRepository repository)
This method is the getAsObject implementation, and has the guarantee that the value is not null


getAsText

public final java.lang.String getAsText(java.lang.Object value,
                                        MessagesRepository repository)
Return the text value for the given object

Parameters:
value - the java object to convert to text
repository - the MessagesRepository object
Returns:
the parsed value (can be null)

getAsTextImpl

protected 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



The Loom Framework 1.6-SNAPSHOT.
Licensed under the Apache License, Version 2.0 by Extrema Sistemas de Informacion S.L.