org.loom.converter
Class AbstractConverter

java.lang.Object
  extended by org.loom.converter.AbstractConverter
All Implemented Interfaces:
Converter, FormInputDecorator
Direct Known Subclasses:
AbstractAutocompletedConverter, AbstractStringConverter, InputStreamConverter, NullConverter, PersistentFileConverter

public abstract class AbstractConverter
extends java.lang.Object
implements Converter


Field Summary
protected  java.lang.Class<?> convertedClass
          class of the values returned by this converter
protected  java.lang.String cssClass
          the CSS class that should be added to any field linked to a property using this Converetr, null for none
 
Constructor Summary
protected AbstractConverter(java.lang.Class<?> convertedClass)
           
 
Method Summary
 void decorate(FormInputTag tag)
          Add CSS class extracted from this converter return type (number, string, file) to the tag.
abstract  java.lang.Object getAsObject(ParameterValue paramValue, Messages messages, MessagesRepository repository)
          Return the object value for the given text
 java.lang.Class<?> getConvertedClass()
           
 java.lang.String getCssClass()
           
 void setConvertedClass(java.lang.Class<?> convertedClass)
           
 void setCssClass(java.lang.String cssClass)
           
 
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
getAsText
 

Field Detail

convertedClass

protected java.lang.Class<?> convertedClass
class of the values returned by this converter


cssClass

protected java.lang.String cssClass
the CSS class that should be added to any field linked to a property using this Converetr, null for none

Constructor Detail

AbstractConverter

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

getConvertedClass

public java.lang.Class<?> getConvertedClass()
Specified by:
getConvertedClass in interface Converter
Returns:
the Class of the converted values.

getAsObject

public abstract java.lang.Object getAsObject(ParameterValue paramValue,
                                             Messages messages,
                                             MessagesRepository repository)
Description copied from interface: Converter
Return the object value for the given text

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

setConvertedClass

public void setConvertedClass(java.lang.Class<?> convertedClass)

decorate

public void decorate(FormInputTag tag)
Add CSS class extracted from this converter return type (number, string, file) to the tag.

Specified by:
decorate in interface FormInputDecorator

getCssClass

public java.lang.String getCssClass()

setCssClass

public void setCssClass(java.lang.String cssClass)


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