|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjoptsimple.internal.Reflection
public abstract class Reflection
Helper methods for reflection.
| Constructor Summary | |
|---|---|
Reflection()
|
|
| Method Summary | ||
|---|---|---|
private static
|
constructorConverter(java.lang.Class<V> clazz)
|
|
static
|
findConverter(java.lang.Class<V> clazz)
Finds an appropriate value converter for the given class. |
|
static
|
instantiate(java.lang.reflect.Constructor<T> constructor,
java.lang.Object... args)
Invokes the given constructor with the given arguments. |
|
static java.lang.Object |
invoke(java.lang.reflect.Method method,
java.lang.Object... args)
Invokes the given static method with the given arguments. |
|
private static boolean |
meetsConverterRequirements(java.lang.reflect.Method method,
java.lang.Class<?> expectedReturnType)
|
|
private static java.lang.RuntimeException |
reflectionException(java.lang.Exception ex)
|
|
private static
|
valueOfConverter(java.lang.Class<V> clazz)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Reflection()
| Method Detail |
|---|
public static <V> ValueConverter<V> findConverter(java.lang.Class<V> clazz)
V - a constraint on the class object to introspectclazz - class to introspect on
private static <V> ValueConverter<V> valueOfConverter(java.lang.Class<V> clazz)
private static <V> ValueConverter<V> constructorConverter(java.lang.Class<V> clazz)
public static <T> T instantiate(java.lang.reflect.Constructor<T> constructor,
java.lang.Object... args)
T - constraint on the type of the objects yielded by the constructorconstructor - constructor to invokeargs - arguments to hand to the constructor
ReflectionException - in lieu of the gaggle of reflection-related exceptions
public static java.lang.Object invoke(java.lang.reflect.Method method,
java.lang.Object... args)
method - method to invokeargs - arguments to hand to the method
ReflectionException - in lieu of the gaggle of reflection-related exceptions
private static boolean meetsConverterRequirements(java.lang.reflect.Method method,
java.lang.Class<?> expectedReturnType)
private static java.lang.RuntimeException reflectionException(java.lang.Exception ex)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||