org.apache.myfaces.trinidadinternal.convert
Class GenericConverter

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.convert.GenericConverter

public abstract class GenericConverter
extends java.lang.Object

This class is capable of converting one Object into another. A converter may be capable of converting a single Object into many different types.

Author:
The Oracle ADF Faces Team

Constructor Summary
GenericConverter()
           
 
Method Summary
abstract  java.lang.Object convert(java.lang.Object source, java.lang.Class<?> targetType)
          converts the given Object into an instance of the targetType.
abstract  java.util.List<java.lang.Class<?>> getTargetTypes(java.lang.Class<?> sourceType)
          Gets all the supported targetTypes for the given sourceType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericConverter

public GenericConverter()
Method Detail

convert

public abstract java.lang.Object convert(java.lang.Object source,
                                         java.lang.Class<?> targetType)
converts the given Object into an instance of the targetType.

Returns:
an instance of the targetType.

getTargetTypes

public abstract java.util.List<java.lang.Class<?>> getTargetTypes(java.lang.Class<?> sourceType)
Gets all the supported targetTypes for the given sourceType. This converter must be able to convert the sourceType into each of the supported targetTypes.

Returns:
Each item is of type Class. An empty list must be returned if the given sourceType cannot be converted into anything.


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.