public class DefaultConverterFactory extends Object implements ConverterFactory, StateReporter.Reportable
| Constructor and Description |
|---|
DefaultConverterFactory()
Constructs a new instance of DefaultConverterFactory using a concurrent
linked hash map as the Converter cache, and a linked hashSet holding the
converters.
|
DefaultConverterFactory(Map<ConverterKey,Converter<Object,Object>> converterCache,
Set<Converter<Object,Object>> converters) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(Type<?> sourceType,
Type<?> destinationType)
Verify if there is an anonymous converter that can handle the conversion
between two types
|
Converter<Object,Object> |
getConverter(String converterId)
Lookup a converter by id
|
Converter<Object,Object> |
getConverter(Type<?> sourceClass,
Type<?> destinationClass)
Lookup for an anonymous converter that can handle the conversion between
these two types
|
boolean |
hasConverter(String converterId)
Check if an identified converter exists
|
<S,D> void |
registerConverter(Converter<S,D> converter)
Register a generic and (anonymous) converter
|
<S,D> void |
registerConverter(String converterId,
Converter<S,D> converter)
Register an identified converter
|
void |
reportCurrentState(StringBuilder out)
Writes details of the current state of this object to the provided
StringBuilder.
|
void |
setMapperFacade(MapperFacade mapperFacade)
Sets the MapperFactory which will be used by this ConverterFactory to obtain
a MapperFacade needed by it's registered converters.
|
public DefaultConverterFactory(Map<ConverterKey,Converter<Object,Object>> converterCache, Set<Converter<Object,Object>> converters)
converterCache - converters - public DefaultConverterFactory()
public void setMapperFacade(MapperFacade mapperFacade)
ConverterFactorysetMapperFacade in interface ConverterFactorypublic boolean canConvert(Type<?> sourceType, Type<?> destinationType)
ConverterFactorycanConvert in interface ConverterFactorypublic boolean hasConverter(String converterId)
ConverterFactoryhasConverter in interface ConverterFactorypublic Converter<Object,Object> getConverter(Type<?> sourceClass, Type<?> destinationClass)
ConverterFactorygetConverter in interface ConverterFactorypublic Converter<Object,Object> getConverter(String converterId)
ConverterFactorygetConverter in interface ConverterFactorypublic <S,D> void registerConverter(Converter<S,D> converter)
ConverterFactoryregisterConverter in interface ConverterFactorypublic <S,D> void registerConverter(String converterId, Converter<S,D> converter)
ConverterFactoryregisterConverter in interface ConverterFactorypublic void reportCurrentState(StringBuilder out)
StateReporter.ReportablereportCurrentState in interface StateReporter.ReportableCopyright © 2017 Glasnost. All Rights Reserved.