org.loom.converter
Class DefaultConverterFactory
java.lang.Object
org.loom.converter.DefaultConverterFactory
- All Implemented Interfaces:
- ConverterFactory
- Direct Known Subclasses:
- GuiceConverterFactory, SpringConverterFactory
@Singleton
public class DefaultConverterFactory
- extends java.lang.Object
- implements ConverterFactory
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultConverterFactory
public DefaultConverterFactory()
DefaultConverterFactory
public DefaultConverterFactory(boolean createDefaultConverters)
- Parameters:
createDefaultConverters
- true to create the default converters
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)