org.databene.commons.converter
Class ToCollectionConverter<C extends java.util.Collection>
java.lang.Object
org.databene.commons.converter.AbstractConverter<S,T>
org.databene.commons.converter.ThreadSafeConverter<java.lang.Object,C>
org.databene.commons.converter.ToCollectionConverter<C>
- All Implemented Interfaces:
- java.lang.Cloneable, Converter<java.lang.Object,C>, ThreadAware
public class ToCollectionConverter<C extends java.util.Collection>
- extends ThreadSafeConverter<java.lang.Object,C>
Converts arrays and collections to collections of same content, everything else is converted to a collection of size 1.
Created: 26.08.2007 16:16:15
|
Method Summary |
C |
convert(java.lang.Object sourceValue)
Concerts an object of type S to an object of type T |
static java.util.Collection |
convert(java.lang.Object sourceValue,
java.lang.Class targetType)
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ToCollectionConverter
public ToCollectionConverter()
ToCollectionConverter
public ToCollectionConverter(java.lang.Class<C> targetType)
convert
public C convert(java.lang.Object sourceValue)
throws ConversionException
- Description copied from interface:
Converter
- Concerts an object of type S to an object of type T
- Parameters:
sourceValue - the object to convert
- Returns:
- the converted object
- Throws:
ConversionException - if the conversion fails
convert
public static java.util.Collection convert(java.lang.Object sourceValue,
java.lang.Class targetType)
Copyright © 2010. All Rights Reserved.