public class PropertyConverterManager extends Object
PropertyConverter
instances.
This class is thread-safe.Constructor and Description |
---|
PropertyConverterManager()
Constructor.
|
PropertyConverterManager(boolean init) |
Modifier and Type | Method and Description |
---|---|
protected <T> org.apache.tamaya.spi.PropertyConverter<T> |
createDefaultPropertyConverter(org.apache.tamaya.TypeLiteral<T> targetType)
Creates a dynamic PropertyConverter for the given target type.
|
Map<org.apache.tamaya.TypeLiteral<?>,List<org.apache.tamaya.spi.PropertyConverter<?>>> |
getPropertyConverters()
Get a map of all property converters currently registered.
|
<T> List<org.apache.tamaya.spi.PropertyConverter<T>> |
getPropertyConverters(org.apache.tamaya.TypeLiteral<T> targetType)
Get the list of all current registered converters for the given target type.
|
protected void |
initConverters()
Registers the default converters provided out of the box.
|
boolean |
isTargetTypeSupported(org.apache.tamaya.TypeLiteral<?> targetType)
Allows to evaluate if a given target type is supported.
|
<T> void |
register(org.apache.tamaya.TypeLiteral<T> targetType,
org.apache.tamaya.spi.PropertyConverter<T> converter)
Registers a ew converter instance.
|
public PropertyConverterManager()
public PropertyConverterManager(boolean init)
protected void initConverters()
public <T> void register(org.apache.tamaya.TypeLiteral<T> targetType, org.apache.tamaya.spi.PropertyConverter<T> converter)
T
- the type.targetType
- the target type, not null.converter
- the converter, not null.public boolean isTargetTypeSupported(org.apache.tamaya.TypeLiteral<?> targetType)
targetType
- the target type, not null.public Map<org.apache.tamaya.TypeLiteral<?>,List<org.apache.tamaya.spi.PropertyConverter<?>>> getPropertyConverters()
createDefaultPropertyConverter(org.apache.tamaya.TypeLiteral)
public <T> List<org.apache.tamaya.spi.PropertyConverter<T>> getPropertyConverters(org.apache.tamaya.TypeLiteral<T> targetType)
So given that list above directly registered mappings always are tried first, before any transitive mapping should be used. Also in all cases @Priority annotations are honored for ordering of the converters in place. Transitive conversion is supported for all directly implemented interfaces (including inherited ones) and the inheritance hierarchy (exception Object). Superinterfaces of implemented interfaces are ignored.
T
- the type classtargetType
- the target type, not null.createDefaultPropertyConverter(org.apache.tamaya.TypeLiteral)
protected <T> org.apache.tamaya.spi.PropertyConverter<T> createDefaultPropertyConverter(org.apache.tamaya.TypeLiteral<T> targetType)
T
- the type classtargetType
- the target typeCopyright © 2014–2016 Apache Software Foundation. All rights reserved.