org.loom.converter
Class DefaultConverterFactory

java.lang.Object
  extended by org.loom.converter.DefaultConverterFactory
All Implemented Interfaces:
ConverterFactory
Direct Known Subclasses:
GuiceConverterFactory, SpringConverterFactory

@Singleton
public class DefaultConverterFactory
extends java.lang.Object
implements ConverterFactory


Constructor Summary
DefaultConverterFactory()
           
DefaultConverterFactory(boolean createDefaultConverters)
           
 
Method Summary
 void addConverterFactory(AnnotationDrivenConverterFactory factory)
           
 Converter getConverter(AnnotationContainer wrapper)
          Usually the Converter is specified by the Class at the end of the chain or any annotation prior to that point that specifies what must be done with that property (a \@Converter annotation with a configured propertyPath)
 Converter getConverterForClass(java.lang.Class propertyClass)
          Return default converter for a simple class
 void setConverter(java.lang.Class clazz, Converter converter)
           
 void setConverters(java.util.Map<java.lang.Class,Converter> convertersByClass)
           
 void setDefaultConverterForClass(java.lang.Class propertyClass, Converter converter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultConverterFactory

public DefaultConverterFactory()

DefaultConverterFactory

public DefaultConverterFactory(boolean createDefaultConverters)
Parameters:
createDefaultConverters - true to create the default converters
Method Detail

setDefaultConverterForClass

public void setDefaultConverterForClass(java.lang.Class propertyClass,
                                        Converter converter)

getConverterForClass

public Converter getConverterForClass(java.lang.Class propertyClass)
Description copied from interface: ConverterFactory
Return default converter for a simple class

Specified by:
getConverterForClass in interface ConverterFactory
Returns:
the default converter for simple classes

getConverter

public Converter getConverter(AnnotationContainer wrapper)
Usually the Converter is specified by the Class at the end of the chain or any annotation prior to that point that specifies what must be done with that property (a \@Converter annotation with a configured propertyPath)

Specified by:
getConverter in interface ConverterFactory
Returns:
the Converter for the leaf Node at the end of a Node chain

setConverters

public void setConverters(java.util.Map<java.lang.Class,Converter> convertersByClass)

setConverter

public void setConverter(java.lang.Class clazz,
                         Converter converter)

addConverterFactory

public void addConverterFactory(AnnotationDrivenConverterFactory factory)