@Vetoed public class PropertyConverterManager extends Object
PropertyConverter
instances.
This class is thread-safe.Constructor and Description |
---|
PropertyConverterManager()
Constructor.
|
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.
|
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(TypeLiteral)
public <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. If not converters are registered, they component tries to create and register a dynamic converter based on String costructor or static factory methods available.
The converters provided are of the following type and returned in the following order:
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). Super interfaces of implemented interfaces are ignored.
T
- the type classtargetType
- the target type, not null.createDefaultPropertyConverter(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.