net.sf.seaf.util.convert.collection
Class SequenceConverterUtils

java.lang.Object
  extended by net.sf.seaf.util.convert.collection.SequenceConverterUtils

public class SequenceConverterUtils
extends Object


Constructor Summary
SequenceConverterUtils()
           
 
Method Summary
 Object convert(Object sourceValue, Class<?> targetType, Class<?> targetComponentType, ObjectConverter<Object,Object> objectConverter)
          Convert an Object array or a Collection to an array or a List of a given component type.
 Object[] convertToArray(Object sourceValue, Class<?> targetComponentType, ObjectConverter<Object,Object> objectConverter)
          Convert an Object array or a Collection to an array of a given component type.
 List<Object> convertToList(Object sourceValue, Class<?> targetComponentType, ObjectConverter<Object,Object> objectConverter)
          Convert an Object array or a Collection to a List of a given component type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceConverterUtils

public SequenceConverterUtils()
Method Detail

convert

public Object convert(Object sourceValue,
                      Class<?> targetType,
                      Class<?> targetComponentType,
                      ObjectConverter<Object,Object> objectConverter)
Convert an Object array or a Collection to an array or a List of a given component type.

Each object is converted using a given object converter.

Parameters:
sourceValue - Object to be converted
targetType - The required target type
targetComponentType - Component type of the target array
objectConverter - Object converter to be used to convert each object
Returns:
Converted array
Throws:
SeafConversionException - When source object is of unsupported type

convertToArray

public Object[] convertToArray(Object sourceValue,
                               Class<?> targetComponentType,
                               ObjectConverter<Object,Object> objectConverter)
Convert an Object array or a Collection to an array of a given component type.

Each object is converted using a given object converter.

Parameters:
sourceValue - Object to be converted
targetComponentType - Component type of the target array
objectConverter - Object converter to be used to convert each object
Returns:
Converted array
Throws:
SeafConversionException - When source object is of unsupported type

convertToList

public List<Object> convertToList(Object sourceValue,
                                  Class<?> targetComponentType,
                                  ObjectConverter<Object,Object> objectConverter)
Convert an Object array or a Collection to a List of a given component type.

Each object is converted using a given object converter.

Parameters:
sourceValue - Object to be converted
targetComponentType - Component type of the target List
objectConverter - Object converter to be used to convert each object
Returns:
Converted List
Throws:
SeafConversionException - When source object is of unsupported type


Copyright © 2008-2012 SEAF. All Rights Reserved.