public class ArrayConverter<T> extends java.lang.Object implements TypeConverter<T[]>
null
value is returned as null
Collections
Modifier and Type | Field and Description |
---|---|
static char[] |
NUMBER_DELIMITERS |
protected java.lang.Class<T> |
targetComponentType |
protected TypeConverterManager |
typeConverterManager |
Constructor and Description |
---|
ArrayConverter(TypeConverterManager typeConverterManager,
java.lang.Class<T> targetComponentType) |
Modifier and Type | Method and Description |
---|---|
T[] |
convert(java.lang.Object value)
Converts object received as parameter into object of another class.
|
protected T[] |
convertArrayToArray(java.lang.Object value)
Converts array value to array.
|
protected T[] |
convertPrimitiveArrayToArray(java.lang.Object value,
java.lang.Class primitiveComponentType)
Converts primitive array to target array.
|
protected java.lang.String[] |
convertStringToArray(java.lang.String value)
Converts string to array, for the
convertValueToArray(Object) method. |
protected T[] |
convertToSingleElementArray(java.lang.Object value)
Creates an array with single element.
|
protected T |
convertType(java.lang.Object value)
Converts type using type converter manager.
|
protected T[] |
convertValueToArray(java.lang.Object value)
Converts non-array value to array.
|
protected T[] |
createArray(int length)
Creates new array of target component type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convert
public static final char[] NUMBER_DELIMITERS
protected final TypeConverterManager typeConverterManager
protected final java.lang.Class<T> targetComponentType
public ArrayConverter(TypeConverterManager typeConverterManager, java.lang.Class<T> targetComponentType)
public T[] convert(java.lang.Object value)
TypeConverter
Integer
converter tries to convert given objects
into target Integer
object. Converters should try all reasonable
ways of conversion into target object, depending on target type.convert
in interface TypeConverter<T[]>
value
- object to convert fromprotected T convertType(java.lang.Object value)
protected T[] createArray(int length)
protected T[] convertToSingleElementArray(java.lang.Object value)
protected T[] convertValueToArray(java.lang.Object value)
protected java.lang.String[] convertStringToArray(java.lang.String value)
convertValueToArray(Object)
method.
By default, the string is converted into an array using CsvUtil
.protected T[] convertArrayToArray(java.lang.Object value)
protected T[] convertPrimitiveArrayToArray(java.lang.Object value, java.lang.Class primitiveComponentType)
Copyright © 2003-present Jodd Team