Package org.apache.axis.utils
Class ArrayUtil
java.lang.Object
org.apache.axis.utils.ArrayUtil
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ArrayUtil.NonConvertable
An object indicating that the conversion is not possible -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 arrayTypestatic boolean
isConvertable
(Class clazz, Class arrayType) Check if the clazz(perhaps ArrayOfT class) can be converted to T[].
-
Field Details
-
NON_CONVERTABLE
An object indicating that the conversion is not possible
-
-
Constructor Details
-
ArrayUtil
public ArrayUtil()
-
-
Method Details
-
convertObjectToArray
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
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
Gets the dimension of arrayType- Parameters:
arrayType
- an array class- Returns:
- the dimension
-
convertArrayToObject
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.
-