public static final class ReflectionUtil.ClassReflection extends Object
Constructor and Description |
---|
ClassReflection(Class<?> handle) |
ClassReflection(Class<?> handle,
boolean recursive) |
Modifier and Type | Method and Description |
---|---|
Field |
getField(String name) |
Collection<Field> |
getFields() |
<T> T |
getFieldValue(String fieldName,
Object instance,
Class<T> type) |
Method |
getMethod(String name) |
Collection<Method> |
getMethods() |
<T> T |
invokeMethod(Class<T> type,
String methodName,
Object instance,
Object... args) |
Object |
newInstance() |
void |
setFieldValue(String fieldName,
Object instance,
Object value) |
public ClassReflection(Class<?> handle)
public ClassReflection(Class<?> handle, boolean recursive)
public Object newInstance() throws IllegalAccessException, InstantiationException
public void setFieldValue(String fieldName, Object instance, Object value) throws IllegalAccessException
IllegalAccessException
public <T> T getFieldValue(String fieldName, Object instance, Class<T> type) throws IllegalAccessException
IllegalAccessException
public <T> T invokeMethod(Class<T> type, String methodName, Object instance, Object... args) throws InvocationTargetException, IllegalAccessException
public Collection<Field> getFields()
public Collection<Method> getMethods()
Copyright © 2016–2021. All rights reserved.