public final class Reflection extends Object
Modifier and Type | Method and Description |
---|---|
static <V> V |
convertWith(ValueConverter<V> converter,
String raw) |
static <V> ValueConverter<V> |
findConverter(Class<V> clazz)
Finds an appropriate value converter for the given class.
|
static <T> T |
instantiate(Constructor<T> constructor,
Object... args)
Invokes the given constructor with the given arguments.
|
static Object |
invoke(Method method,
Object... args)
Invokes the given static method with the given arguments.
|
public static <V> ValueConverter<V> findConverter(Class<V> clazz)
V
- a constraint on the class object to introspectclazz
- class to introspect onpublic static <T> T instantiate(Constructor<T> constructor, Object... args)
T
- constraint on the type of the objects yielded by the constructorconstructor
- constructor to invokeargs
- arguments to hand to the constructorReflectionException
- in lieu of the gaggle of reflection-related exceptionspublic static Object invoke(Method method, Object... args)
method
- method to invokeargs
- arguments to hand to the methodReflectionException
- in lieu of the gaggle of reflection-related exceptionspublic static <V> V convertWith(ValueConverter<V> converter, String raw)
Copyright © 2016. All Rights Reserved.