@Service public class DomainTransportConverterRegistry extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.DisposableBean
| Modifier and Type | Class and Description |
|---|---|
static class |
DomainTransportConverterRegistry.SourceTarget
Holder for a source-to-target class pair used for the converter registry.
|
| Constructor and Description |
|---|
DomainTransportConverterRegistry()
Instantiates a new domain transport converter registry.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(Class<?> sourceType,
Class<?> targetType)
Determine if a conversion is supported.
|
boolean |
canConvert(org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.TypeDescriptor targetType)
Determine if a conversion is supported.
|
void |
destroy() |
<S,T> DomainTransportTransfer<S,T> |
getConverter(Class<?> sourceType,
Class<?> targetType)
Find a converter for a given domain or transport type.
|
<S,T> DomainTransportTransfer<S,T> |
getConverter(OSRole<?> osRole)
Get a converter for a given
OSRole. |
<S,T> DomainTransportTransfer<S,T> |
getConverter(org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.TypeDescriptor targetType) |
void |
setApplicationContext(org.springframework.context.ApplicationContext ctx) |
public DomainTransportConverterRegistry()
public boolean canConvert(Class<?> sourceType, Class<?> targetType)
sourceType - the source type to convert fromtargetType - the target type to convert to.public boolean canConvert(org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.TypeDescriptor targetType)
sourceType - the source type to convert fromtargetType - the target type to convert to.public <S,T> DomainTransportTransfer<S,T> getConverter(Class<?> sourceType, Class<?> targetType)
Note that the converters are stored with both transport and domain type as key, so both will give the same result.
S - The generic type of the source classT - The generic type of the target classsourceType - The source typetargetType - The target typenull if no converter
is foundpublic <S,T> DomainTransportTransfer<S,T> getConverter(org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType)
S - The generic type of the source classT - The generic type of the target classsourceType - The type descriptor for the source typetargetType - The TypeDescriptor for the target typeTypeDescriptorpublic <S,T> DomainTransportTransfer<S,T> getConverter(OSRole<?> osRole)
OSRole.S - The generic type of the source classT - The generic type of the target classosRole - the OSRole to get the converter for.public void destroy()
throws Exception
destroy in interface org.springframework.beans.factory.DisposableBeanExceptionpublic void setApplicationContext(org.springframework.context.ApplicationContext ctx)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionCopyright © 2006–2020 Esito AS. All rights reserved.