- java.lang.Object
-
- net.sourceforge.argparse4j.helper.ReflectHelper
-
public final class ReflectHelper extends java.lang.ObjectThis class provides helper functions related to reflection.
The application code should not use this class directly.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateReflectHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Objectlist2Array(java.lang.Class<?> targetType, java.lang.Object src)Convertsrcto object of typetargetTyperecursively
-
-
-
Method Detail
-
list2Array
public static java.lang.Object list2Array(java.lang.Class<?> targetType, java.lang.Object src)Convert
srcto object of typetargetTyperecursivelyConvert
srcto object of typetargetTyperecursively, but it only convertsListto array. IftargetTypeis array type andsrcisList, new array is created with the size ofsrcand for each element ofsrc, this method will be called recursively with the component type oftargetTypeand the element ofsrc. The returned object is assigned to newly created array. If eithertargetTypeis not array orsrcis notList, simply returnssrc.- Parameters:
targetType- The target typesrc- The src object- Returns:
- The converted object
-
-