net.sf.mmm.util.value.base
Class AbstractComposedValueConverter

java.lang.Object
  extended by net.sf.mmm.util.component.AbstractComponent
      extended by net.sf.mmm.util.component.AbstractLoggable
          extended by net.sf.mmm.util.value.base.AbstractValueConverter<Object,Object>
              extended by net.sf.mmm.util.value.base.AbstractComposedValueConverter
All Implemented Interfaces:
ComposedValueConverter, ValueConverter<Object,Object>
Direct Known Subclasses:
ComposedValueConverterImpl

public abstract class AbstractComposedValueConverter
extends AbstractValueConverter<Object,Object>
implements ComposedValueConverter

This is the abstract base implementation of the ComposedValueConverter interface.

Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Constructor Summary
AbstractComposedValueConverter()
          The constructor.
 
Method Summary
 Class<Object> getSourceType()
          This the type of the value accepted by this converter.
 Class<Object> getTargetType()
          Is the guaranteed return-type of the conversion.
 
Methods inherited from class net.sf.mmm.util.value.base.AbstractValueConverter
convert, doInitialize, getReflectionUtil, setReflectionUtil
 
Methods inherited from class net.sf.mmm.util.component.AbstractLoggable
getLogger, setLogger
 
Methods inherited from class net.sf.mmm.util.component.AbstractComponent
getInitializationState, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.mmm.util.value.api.ValueConverter
convert, convert
 

Constructor Detail

AbstractComposedValueConverter

public AbstractComposedValueConverter()
The constructor.

Method Detail

getSourceType

public final Class<Object> getSourceType()
This the type of the value accepted by this converter. Use Object if you want to accept any value. A very common source-type is String.

Specified by:
getSourceType in interface ValueConverter<Object,Object>
Returns:
the source-type.

getTargetType

public final Class<Object> getTargetType()
Is the guaranteed return-type of the conversion. This information is used externally to choose the most specific ValueConverter that is appropriate for the conversion.
E.g. a generic converter can have Object as target-type while a specific converter may have Collection as target-type. Now if an object (compliant with the source-type) needs to be converted to a Collection or List, the specific converter is used while for other objects the generic converter is chosen.
Please note that the target-type is often more general than the actual returned result. So a ValueConverter that converts a comma-separated String to an ArrayList will typically declare List as target-type.

Specified by:
getTargetType in interface ValueConverter<Object,Object>
Returns:
the target-type.


Copyright © 2001-2008 mmm-Team. All Rights Reserved.