java.lang.Object
net.sourceforge.argparse4j.helper.ReflectHelper
This class provides helper functions related to reflection.
The application code should not use this class directly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Objectlist2Array(Class<?> targetType, Object src) Convertsrcto object of typetargetTyperecursively
-
Constructor Details
-
ReflectHelper
private ReflectHelper()
-
-
Method Details
-
list2Array
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
-