public class SimpleGenericValueConverterImpl extends AbstractLoggableComponent implements SimpleGenericValueConverter
ComposedValueConverter
instead.Modifier and Type | Field and Description |
---|---|
private Iso8601UtilLimited |
iso8601Util |
private MathUtilLimited |
mathUtil |
Constructor and Description |
---|
SimpleGenericValueConverterImpl()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
convert(Object value,
Object valueSource,
Class<T> targetClass)
This method converts the given
pojo to the <TARGET>-type. |
protected void |
doInitialize()
This method performs the actual
initialization . |
protected Iso8601UtilLimited |
getIso8601Util() |
protected MathUtilLimited |
getMathUtil() |
void |
setIso8601Util(Iso8601UtilLimited iso8601Util) |
void |
setMathUtil(MathUtilLimited mathUtil) |
createLogger, getLogger
doInitialized, getInitializationState, initialize
private Iso8601UtilLimited iso8601Util
private MathUtilLimited mathUtil
public SimpleGenericValueConverterImpl()
protected Iso8601UtilLimited getIso8601Util()
@Inject public void setIso8601Util(Iso8601UtilLimited iso8601Util)
iso8601Util
- is the iso8601Util to setprotected MathUtilLimited getMathUtil()
@Inject public void setMathUtil(MathUtilLimited mathUtil)
mathUtil
- is the mathUtil to setprotected void doInitialize()
AbstractComponent
initialization
. It is called when AbstractComponent.initialize()
is
invoked for the first time. super.
AbstractComponent.doInitialize()
.doInitialize
in class AbstractLoggableComponent
public <T> T convert(Object value, Object valueSource, Class<T> targetClass) throws ValueException
SimpleValueConverter
pojo
to the <TARGET>-type.convert
in interface SimpleValueConverter<Object,Object>
T
- is the generic type of targetClass
.value
- is the value to convert.valueSource
- describes the source of the value. This may be the filename where the value was read
from, an XPath where the value was located in an XML document, etc. It is used in exceptions
thrown if something goes wrong. This will help to find the problem easier.targetClass
- is the type to convert the value
to.value
or null
if the conversion is NOT possible. The returned value
has to be an instance
of the given targetType
.ValueException
- if the conversion failed (e.g. the given value
is illegal for the given
targetClass
).ValueException
Copyright © 2001–2016 mmm-Team. All rights reserved.