SOURCE - is the generic source-type.TARGET - is the generic target-type.public abstract class AbstractValueConverter<SOURCE,TARGET> extends AbstractComponent implements ValueConverter<SOURCE,TARGET>
ValueConverter interface.| Modifier and Type | Field and Description |
|---|---|
private ReflectionUtil |
reflectionUtil |
| Constructor and Description |
|---|
AbstractValueConverter()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends TARGET> |
convert(SOURCE value,
Object valueSource,
Class<T> targetClass)
This method converts the given
pojo to the <TARGET>-type. |
protected void |
doInitialize() |
ReflectionUtil |
getReflectionUtil()
This method gets the
ReflectionUtilImpl instance to use. |
void |
setReflectionUtil(ReflectionUtil reflectionUtil) |
doInitialized, getInitializationState, initializeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvert, getSourceType, getTargetTypeprivate ReflectionUtil reflectionUtil
public ReflectionUtil getReflectionUtil()
ReflectionUtilImpl instance to use.ReflectionUtilImpl to use.@Inject public void setReflectionUtil(ReflectionUtil reflectionUtil)
reflectionUtil - is the reflectionUtil to setprotected void doInitialize()
doInitialize in class AbstractComponentpublic final <T extends TARGET> T convert(SOURCE value, Object valueSource, Class<T> targetClass)
SimpleValueConverterpojo to the <TARGET>-type.convert in interface SimpleValueConverter<SOURCE,TARGET>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.Copyright © 2001–2019 mmm-Team. All rights reserved.