Package org.apache.axis.utils
Class ArrayUtil
- java.lang.Object
-
- org.apache.axis.utils.ArrayUtil
-
public class ArrayUtil extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ArrayUtil.NonConvertable
-
Field Summary
Fields Modifier and Type Field Description static ArrayUtil.NonConvertable
NON_CONVERTABLE
An object indicating that the conversion is not possible
-
Constructor Summary
Constructors Constructor Description ArrayUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Object
convertArrayToObject(java.lang.Object array, java.lang.Class destClass)
Convert an array object of which type is T[] to ArrayOfT class.static java.lang.Object
convertObjectToArray(java.lang.Object obj, java.lang.Class arrayType)
Convert ArrayOfT to T[].static int
getArrayDimension(java.lang.Class arrayType)
Gets the dimension of arrayTypestatic boolean
isConvertable(java.lang.Class clazz, java.lang.Class arrayType)
Check if the clazz(perhaps ArrayOfT class) can be converted to T[].
-
-
-
Field Detail
-
NON_CONVERTABLE
public static final ArrayUtil.NonConvertable NON_CONVERTABLE
An object indicating that the conversion is not possible
-
-
Method Detail
-
convertObjectToArray
public static java.lang.Object convertObjectToArray(java.lang.Object obj, java.lang.Class arrayType)
Convert ArrayOfT to T[].- Parameters:
obj
- the object of type ArrayOfT to convertarrayType
- the destination array type- Returns:
- returns the converted array object. If not convertable the original obj argument is returned. If the obj is not type of ArrayOfT or the value is null, null is returned.
-
isConvertable
public static boolean isConvertable(java.lang.Class clazz, java.lang.Class arrayType)
Check if the clazz(perhaps ArrayOfT class) can be converted to T[].- Parameters:
clazz
- a class of ArrayOfTarrayType
- an array class (T[])- Returns:
- true if converable, false if not
-
getArrayDimension
public static int getArrayDimension(java.lang.Class arrayType)
Gets the dimension of arrayType- Parameters:
arrayType
- an array class- Returns:
- the dimension
-
convertArrayToObject
public static java.lang.Object convertArrayToObject(java.lang.Object array, java.lang.Class destClass)
Convert an array object of which type is T[] to ArrayOfT class.- Parameters:
array
- the array objectdestClass
- the destination class- Returns:
- the object of type destClass if convertable, null if not.
-
-