public final class ReflectionUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ReflectionUtils.DataType |
static class |
ReflectionUtils.PackageType |
Modifier and Type | Method and Description |
---|---|
static Constructor<?> |
getConstructor(Class<?> clazz,
Class<?>... parameterTypes) |
static Constructor<?> |
getConstructor(String className,
ReflectionUtils.PackageType packageType,
Class<?>... parameterTypes) |
static Field |
getField(Class<?> clazz,
boolean declared,
String fieldName) |
static Field |
getField(String className,
ReflectionUtils.PackageType packageType,
boolean declared,
String fieldName) |
static Method |
getMethod(Class<?> clazz,
String methodName,
Class<?>... parameterTypes) |
static Method |
getMethod(String className,
ReflectionUtils.PackageType packageType,
String methodName,
Class<?>... parameterTypes) |
static Object |
getValue(Object instance,
boolean declared,
String fieldName) |
static Object |
getValue(Object instance,
Class<?> clazz,
boolean declared,
String fieldName) |
static Object |
getValue(Object instance,
String className,
ReflectionUtils.PackageType packageType,
boolean declared,
String fieldName) |
static Object |
instantiateObject(Class<?> clazz,
Object... arguments) |
static Object |
instantiateObject(String className,
ReflectionUtils.PackageType packageType,
Object... arguments) |
static Object |
invokeMethod(Object instance,
Class<?> clazz,
String methodName,
Object... arguments) |
static Object |
invokeMethod(Object instance,
String methodName,
Object... arguments) |
static Object |
invokeMethod(Object instance,
String className,
ReflectionUtils.PackageType packageType,
String methodName,
Object... arguments) |
static void |
setValue(Object instance,
boolean declared,
String fieldName,
Object value) |
static void |
setValue(Object instance,
Class<?> clazz,
boolean declared,
String fieldName,
Object value) |
static void |
setValue(Object instance,
String className,
ReflectionUtils.PackageType packageType,
boolean declared,
String fieldName,
Object value) |
public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... parameterTypes) throws NoSuchMethodException
NoSuchMethodException
public static Constructor<?> getConstructor(String className, ReflectionUtils.PackageType packageType, Class<?>... parameterTypes) throws NoSuchMethodException, ClassNotFoundException
public static Object instantiateObject(Class<?> clazz, Object... arguments) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException
public static Object instantiateObject(String className, ReflectionUtils.PackageType packageType, Object... arguments) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException
NoSuchMethodException
public static Method getMethod(String className, ReflectionUtils.PackageType packageType, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException, ClassNotFoundException
public static Object invokeMethod(Object instance, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException
public static Object invokeMethod(Object instance, Class<?> clazz, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException
public static Object invokeMethod(Object instance, String className, ReflectionUtils.PackageType packageType, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException
public static Field getField(Class<?> clazz, boolean declared, String fieldName) throws NoSuchFieldException, SecurityException
public static Field getField(String className, ReflectionUtils.PackageType packageType, boolean declared, String fieldName) throws NoSuchFieldException, SecurityException, ClassNotFoundException
public static Object getValue(Object instance, Class<?> clazz, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException
public static Object getValue(Object instance, String className, ReflectionUtils.PackageType packageType, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, ClassNotFoundException
public static Object getValue(Object instance, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException
public static void setValue(Object instance, Class<?> clazz, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException
public static void setValue(Object instance, String className, ReflectionUtils.PackageType packageType, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, ClassNotFoundException
public static void setValue(Object instance, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException
Copyright © 2020. All rights reserved.