ma.glasnost.orika.converter
Interface ConverterFactory

All Known Implementing Classes:
DefaultConverterFactory

public interface ConverterFactory


Method Summary
 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<?> sourceType, Type<?> destinationType)
          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(Converter<S,D> converter)
          Deprecated. use registerConverter(Converter) instead
<S,D> void
registerConverter(String converterId, Converter<S,D> converter)
          Register an identified converter
<S,D> void
registerConverter(String converterId, Converter<S,D> converter)
          Deprecated. use registerConverter(String, Converter) instead
 void setMapperFacade(MapperFacade mapperFacade)
          Sets the MapperFactory which will be used by this ConverterFactory to obtain a MapperFacade needed by it's registered converters.
 

Method Detail

setMapperFacade

void setMapperFacade(MapperFacade mapperFacade)
Sets the MapperFactory which will be used by this ConverterFactory to obtain a MapperFacade needed by it's registered converters.

Parameters:
mapperfactory -

getConverter

Converter<Object,Object> getConverter(Type<?> sourceType,
                                      Type<?> destinationType)
Lookup for an anonymous converter that can handle the conversion between these two types

Parameters:
sourceType -
destinationType -
Returns:
converter

getConverter

Converter<Object,Object> getConverter(String converterId)
Lookup a converter by id

Parameters:
converterId -
Returns:

registerConverter

<S,D> void registerConverter(Converter<S,D> converter)
Register a generic and (anonymous) converter

Parameters:
converter -

registerConverter

@Deprecated
<S,D> void registerConverter(Converter<S,D> converter)
Deprecated. use registerConverter(Converter) instead

Register an identified converter

Parameters:
converterId -
converter -

registerConverter

<S,D> void registerConverter(String converterId,
                             Converter<S,D> converter)
Register an identified converter

Parameters:
converterId -
converter -

registerConverter

@Deprecated
<S,D> void registerConverter(String converterId,
                                        Converter<S,D> converter)
Deprecated. use registerConverter(String, Converter) instead

Register an identified converter

Parameters:
converterId -
converter -

hasConverter

boolean hasConverter(String converterId)
Check if an identified converter exists

Parameters:
converterId -
Returns:

canConvert

boolean canConvert(Type<?> sourceType,
                   Type<?> destinationType)
Verify if there is an anonymous converter that can handle the conversion between two types

Parameters:
sourceType -
destinationType -
Returns:
true / false


Copyright © 2013 Glasnost. All Rights Reserved.