public final class Reflections extends Object
Modifier and Type | Method and Description |
---|---|
static Class<?> |
asType(Class<?> type) |
static Object |
get(Object object,
String propertyName)
Get value of property for specified object.
|
static String |
getterMethodName(String propertyName) |
static <T> T |
invoke(Object object,
String method) |
static <T> T |
invoke(Object object,
String method,
Object argument) |
static <T> T |
invoke(Object object,
String method,
Object argument,
Class<?> argumentType) |
static void |
set(Object object,
Map<String,Object> parameters)
Sets parameters for specified object.
|
static void |
set(Object object,
String propertyName,
Object value)
Sets property to value for specified object.
|
static Field |
setAccessible(Object object,
String propertyName) |
static String |
setterMethodName(String propertyName) |
static Class<?> |
toPrimitive(Class<?> type) |
static Class<?> |
toType(Class<?> type) |
public static String getterMethodName(String propertyName)
propertyName
- public static Object get(Object object, String propertyName)
object
- propertyName
- public static String setterMethodName(String propertyName)
propertyName
- public static void set(Object object, String propertyName, Object value)
object
- propertyName
- value
- public static void set(Object object, Map<String,Object> parameters)
object
- parameters
- public static Class<?> toPrimitive(Class<?> type)
type
- Class
IllegalArgumentException
- ig specified Class
is not Class.isPrimitive()
public static Class<?> toType(Class<?> type)
type
- Class
IllegalArgumentException
- ig specified Class
is not Class.isPrimitive()
public static Class<?> asType(Class<?> type)
type
- Class
. Namely convert primitive to their type counterpart.Class.isPrimitive()
,
toType(java.lang.Class)
public static <T> T invoke(Object object, String method, Object argument)
T
- object
- method
- argument
- for inferred type from arguments
public static <T> T invoke(Object object, String method, Object argument, Class<?> argumentType)
T
- object
- method
- argument
- argumentType
- Copyright © 2010–2015 MuleSoft, Inc.. All rights reserved.