public class JConverter extends Object
Modifier and Type | Field and Description |
---|---|
protected ConverterManager |
converterManager |
protected FactoryManager |
factoryManager |
Modifier | Constructor and Description |
---|---|
|
JConverter() |
|
JConverter(ConverterManager converterManager,
FactoryManager factoryManager) |
protected |
JConverter(JGum jgum) |
Modifier and Type | Method and Description |
---|---|
<T> T |
convert(Object key,
Object source,
Type targetType) |
<T> T |
convert(Object source,
Type targetType) |
protected ConverterManager |
getConverterManager() |
protected FactoryManager |
getInstantiationManager() |
<T> T |
instantiate(Object key,
Type targetType) |
<T> T |
instantiate(Type targetType) |
protected final ConverterManager converterManager
protected final FactoryManager factoryManager
public JConverter()
protected JConverter(JGum jgum)
jgum
- a categorization context.public JConverter(ConverterManager converterManager, FactoryManager factoryManager)
converterManager
- a converter manager responsible of converting objects.factoryManager
- an instance creator manager responsible of instantiating objects.protected ConverterManager getConverterManager()
protected FactoryManager getInstantiationManager()
public <T> T convert(Object source, Type targetType)
source
- the object to convert.targetType
- the desired type.public <T> T convert(Object key, Object source, Type targetType)
key
- constrains the registered converters and factories that will be looked up in this operation.source
- the object to convert.targetType
- the desired type.public <T> T instantiate(Type targetType)
targetType
- the type to instantiate.Copyright © 2014. All rights reserved.