Package jodd.typeconverter.impl
Class ClassArrayConverter
- java.lang.Object
-
- jodd.typeconverter.impl.ArrayConverter<java.lang.Class>
-
- jodd.typeconverter.impl.ClassArrayConverter
-
- All Implemented Interfaces:
TypeConverter<java.lang.Class[]>
public class ClassArrayConverter extends ArrayConverter<java.lang.Class>
Converts given object toClassarray. Conversion rules:nullvalue is returned asnull- object of destination type is simply casted
- single Class is wrapped in 1-length array
- string value is converted to string array (from CSV format) and then each element is converted
- The following chars are delimiters:
,;\n. - Blank lines are ignored
- Lines that starts with '#' (after trim) are ignored.
-
-
Field Summary
-
Fields inherited from class jodd.typeconverter.impl.ArrayConverter
NUMBER_DELIMITERS, targetComponentType, typeConverterManager
-
-
Constructor Summary
Constructors Constructor Description ClassArrayConverter(TypeConverterManager typeConverterManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String[]convertStringToArray(java.lang.String value)Converts string to array, for theArrayConverter.convertValueToArray(Object)method.protected java.lang.Class[]createArray(int length)Creates new array of target component type.-
Methods inherited from class jodd.typeconverter.impl.ArrayConverter
convert, convertArrayToArray, convertPrimitiveArrayToArray, convertToSingleElementArray, convertType, convertValueToArray
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jodd.typeconverter.TypeConverter
convert
-
-
-
-
Constructor Detail
-
ClassArrayConverter
public ClassArrayConverter(TypeConverterManager typeConverterManager)
-
-
Method Detail
-
createArray
protected java.lang.Class[] createArray(int length)
Description copied from class:ArrayConverterCreates new array of target component type. Default implementation uses reflection to create an array of target type. Override it for better performances.- Overrides:
createArrayin classArrayConverter<java.lang.Class>
-
convertStringToArray
protected java.lang.String[] convertStringToArray(java.lang.String value)
Description copied from class:ArrayConverterConverts string to array, for theArrayConverter.convertValueToArray(Object)method. By default, the string is converted into an array usingCsvUtil.- Overrides:
convertStringToArrayin classArrayConverter<java.lang.Class>
-
-