public class DefaultConverterRegistry extends java.lang.Object implements MutableConverterRegistry
Converter.| Modifier and Type | Class and Description |
|---|---|
protected static class |
DefaultConverterRegistry.SourceComparator |
| Constructor and Description |
|---|
DefaultConverterRegistry() |
| Modifier and Type | Method and Description |
|---|---|
<S,D> void |
addConverter(Converter<S,D> converter,
java.lang.Class<? extends S> source,
java.lang.Class<? extends D> destination)
Registers new converter as a way of converting particular type into other.
|
<S,T> Converter<S,T> |
getConverterForSource(java.lang.Class<? extends S> sourceClass)
Looks for converter able to convert objects from provided type
|
<S,T> Converter<S,T> |
getConverterForTarget(java.lang.Class<? extends T> targetClass)
Looks for converter able to convert objects to provided type
|
<S,T> <any> |
getConverterParameters(Converter<S,T> converter)
Gets source and target types of provided converter
|
protected java.util.Map<<any>,Converter> |
getRegistry() |
<S,T> java.lang.Class<S> |
getSourceClass(java.lang.Class<? extends T> targetClass)
Looks for source type that is assigned for provided.
|
<S,T> java.lang.Class<T> |
getTargetClass(java.lang.Class<? extends S> sourceClass)
Looks for target type that is assigned for provided.
|
void |
setRegistry(java.util.Map<<any>,Converter> registry) |
public <S,T> <any> getConverterParameters(Converter<S,T> converter)
ConverterRegistrygetConverterParameters in interface ConverterRegistryS - type of sourceT - type of targetconverter - converter to be checkedpublic <S,T> java.lang.Class<S> getSourceClass(java.lang.Class<? extends T> targetClass)
ConverterRegistrygetSourceClass in interface ConverterRegistryS - type of sourceT - type of targettargetClass - source object typenull if no converter was found for specified targetpublic <S,T> Converter<S,T> getConverterForTarget(java.lang.Class<? extends T> targetClass)
ConverterRegistrygetConverterForTarget in interface ConverterRegistryS - type of sourceT - type of targettargetClass - target object typenull if no converter was found for
specified targetpublic <S,T> java.lang.Class<T> getTargetClass(java.lang.Class<? extends S> sourceClass)
ConverterRegistrygetTargetClass in interface ConverterRegistryS - type of sourceT - type of targetsourceClass - source object typenull if no converter was found for specified sourcepublic <S,T> Converter<S,T> getConverterForSource(java.lang.Class<? extends S> sourceClass)
ConverterRegistrygetConverterForSource in interface ConverterRegistryS - type of sourceT - type of targetsourceClass - source object typenull if no converter was found for
specified sourceprotected java.util.Map<<any>,Converter> getRegistry()
public void setRegistry(java.util.Map<<any>,Converter> registry)
public <S,D> void addConverter(Converter<S,D> converter, java.lang.Class<? extends S> source, java.lang.Class<? extends D> destination)
MutableConverterRegistryIf any other converter was already registered for provided conversion pair, it will be overwritten.
addConverter in interface MutableConverterRegistryS - type of source objectD - type of target objectconverter - converter to be registeredsource - conversion source typedestination - conversion target classCopyright © 2018 SAP SE. All Rights Reserved.