org.apache.axis.utils
Class ArrayUtil
java.lang.Object
org.apache.axis.utils.ArrayUtil
public class ArrayUtil
extends java.lang.Object
static Object | convertArrayToObject(Object array, Class destClass) - Convert an array object of which type is T[] to ArrayOfT class.
|
static Object | convertObjectToArray(Object obj, Class arrayType) - Convert ArrayOfT to T[].
|
static int | getArrayDimension(Class arrayType) - Gets the dimension of arrayType
|
static boolean | isConvertable(Class clazz, Class arrayType) - Check if the clazz(perhaps ArrayOfT class) can be converted to T[].
|
NON_CONVERTABLE
public static final ArrayUtil.NonConvertable NON_CONVERTABLE
An object indicating that the conversion is not possible
convertArrayToObject
public static Object convertArrayToObject(Object array,
Class destClass)
Convert an array object of which type is T[] to ArrayOfT class.
array
- the array objectdestClass
- the destination class
- the object of type destClass if convertable, null if not.
convertObjectToArray
public static Object convertObjectToArray(Object obj,
Class arrayType)
Convert ArrayOfT to T[].
obj
- the object of type ArrayOfT to convertarrayType
- the destination array type
- 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.
getArrayDimension
public static int getArrayDimension(Class arrayType)
Gets the dimension of arrayType
arrayType
- an array class
- the dimension
isConvertable
public static boolean isConvertable(Class clazz,
Class arrayType)
Check if the clazz(perhaps ArrayOfT class) can be converted to T[].
clazz
- a class of ArrayOfTarrayType
- an array class (T[])
- true if converable, false if not
Copyright B) 2005 Apache Web Services Project. All Rights Reserved.