public final class ReflectUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Class<?>[] |
getAllClasses(Class<?> c)
Returns all superclasses and interfaces of the given class,
incl.
|
static Field[] |
getAllFields(Class<?> c)
Returns all fields of the given class, incl.
|
static Object |
getInstance(String cName,
Class<?>[] paramTypes,
Object[] paramValues)
Returns an instance of the class by the given name, using its
constructor with the given parameter types, and invoked using
the given parameters.
|
public static Class<?>[] getAllClasses(Class<?> c)
c - The class.public static Field[] getAllFields(Class<?> c)
c - The class.public static Object getInstance(String cName, Class<?>[] paramTypes, Object[] paramValues) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException
ExceptUtils.isInterruptException(Throwable).cName - The class name.paramTypes - The constructor parameter types.paramValues - The constructor parameters.ClassNotFoundException - Thrown if a reflection failure
occurs.IllegalAccessException - Thrown if a reflection failure
occurs.InstantiationException - Thrown if a reflection failure
occurs.NoSuchMethodException - Thrown if a reflection failure
occurs.InvocationTargetException - Thrown if a reflection
failure occurs.Copyright © 2015. All Rights Reserved.