net.sf.mmm.util.value.base
Class AbstractValueConverter<SOURCE,TARGET>
java.lang.Object
net.sf.mmm.util.component.base.AbstractComponent
net.sf.mmm.util.component.base.AbstractLoggableComponent
net.sf.mmm.util.value.base.AbstractValueConverter<SOURCE,TARGET>
- Type Parameters:
SOURCE
- is the generic source-type
.TARGET
- is the generic target-type
.
- All Implemented Interfaces:
- SimpleValueConverter<SOURCE,TARGET>, ValueConverter<SOURCE,TARGET>
- Direct Known Subclasses:
- AbstractRecursiveValueConverter, ValueConverterToClass
public abstract class AbstractValueConverter<SOURCE,TARGET>
- extends AbstractLoggableComponent
- implements ValueConverter<SOURCE,TARGET>
This is the abstract base-implementation of the ValueConverter
interface.
- Since:
- 1.0.1
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
reflectionUtil
private ReflectionUtil reflectionUtil
- See Also:
getReflectionUtil()
AbstractValueConverter
public AbstractValueConverter()
- The constructor.
getReflectionUtil
public ReflectionUtil getReflectionUtil()
- This method gets the
ReflectionUtilImpl
instance to use.
- Returns:
- the
ReflectionUtilImpl
to use.
setReflectionUtil
@Inject
public void setReflectionUtil(ReflectionUtil reflectionUtil)
- Parameters:
reflectionUtil
- is the reflectionUtil to set
doInitialize
protected void doInitialize()
- This method performs the actual
initialization
. It is
called when AbstractComponent.initialize()
is invoked for the first time.
ATTENTION:
When you override this method from a sub-class you need to do a
super.AbstractComponent.doInitialize()
.
- Overrides:
doInitialize
in class AbstractLoggableComponent
convert
public final TARGET convert(SOURCE value,
Object valueSource,
Class<? extends TARGET> targetClass)
- This method converts the given
pojo
to the
<TARGET>-type.
- Specified by:
convert
in interface SimpleValueConverter<SOURCE,TARGET>
- Specified by:
convert
in interface ValueConverter<SOURCE,TARGET>
- Parameters:
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.
- Returns:
- the converted
value
or null
if the
conversion is NOT possible. The returned value has to be an
instance
of the given
targetType
. - See Also:
ValueConverter.convert(Object, Object, GenericType)
Copyright © 2001-2010 mmm-Team. All Rights Reserved.