org.databene.commons.converter
Class ArrayConverter<S,T>
java.lang.Object
org.databene.commons.converter.MultiConverterWrapper<S,T>
org.databene.commons.converter.ArrayConverter<S,T>
- All Implemented Interfaces:
- Converter<S[],T[]>, ThreadAware
- Direct Known Subclasses:
- ArrayTypeConverter
public class ArrayConverter<S,T>
- extends MultiConverterWrapper<S,T>
- implements Converter<S[],T[]>
Converts arrays from one component type to arrays of another component type.
Created: 07.06.2007 14:35:18
- Author:
- Volker Bergmann
|
Constructor Summary |
ArrayConverter(java.lang.Class<S> sourceComponentType,
java.lang.Class<T> targetComponentType,
Converter<S,T>... converters)
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ArrayConverter
public ArrayConverter(java.lang.Class<S> sourceComponentType,
java.lang.Class<T> targetComponentType,
Converter<S,T>... converters)
getSourceType
public java.lang.Class<S[]> getSourceType()
- Specified by:
getSourceType in interface Converter<S[],T[]>
getTargetType
public java.lang.Class<T[]> getTargetType()
- Specified by:
getTargetType in interface Converter<S[],T[]>
convert
public T[] convert(S[] sourceValues)
throws ConversionException
- Description copied from interface:
Converter
- Concerts an object of type S to an object of type T
- Specified by:
convert in interface Converter<S[],T[]>
- Parameters:
sourceValues - the object to convert
- Returns:
- the converted object
- Throws:
ConversionException - if the conversion fails
convert
public static <S,T> T[] convert(S[] sourceValues,
Converter<S,T> converter,
java.lang.Class<T> componentType)
throws ConversionException
- Throws:
ConversionException
Copyright © 2010. All Rights Reserved.