public class JavaReflection extends AbstractReflection
| 限定符和类型 | 类和说明 |
|---|---|
static class |
JavaReflection.Null |
| 限定符和类型 | 方法和说明 |
|---|---|
static JavaInvoker<Constructor> |
findConstructorInvoker(List<Constructor<?>> constructors,
Class<?>[] parameterTypes) |
static <T extends Executable> |
findInvoker(List<JavaInvoker<T>> executables,
Class<?>[] parameterTypes) |
static JavaInvoker<Method> |
findMethodInvoker(List<JavaInvoker<Method>> methods,
Class<?>[] parameterTypes) |
static Map<Class<?>,List<Class<?>>> |
getExtensionMap() |
JavaInvoker<Method> |
getExtensionMethod(Object obj,
String name,
Object... arguments) |
Field |
getField(Object obj,
String name)
Returns an opaque handle to a field with the given name or null if the field could not be found
|
Object |
getFieldValue(Object obj,
Field field)
Returns the value of the field from the object.
|
JavaInvoker<Method> |
getFunction(String name,
Object... arguments) |
static List<JavaInvoker<Method>> |
getFunctions() |
JavaInvoker<Method> |
getMethod(Object obj,
String name,
Object... arguments)
Returns an opaque handle to the method with the given name best matching the signature implied by the given arguments, or
null if the method could not be found.
|
static String[] |
getStringTypes(Object[] objects) |
static boolean |
isPrimitiveAssignableFrom(Class<?> from,
Class<?> to)
Returns whether the from type can be assigned to the to type, assuming either type is a (boxed) primitive type.
|
static void |
registerFunction(Object target) |
void |
registerImplicitConvert(ClassImplicitConvert classImplicitConvert) |
void |
registerMethodExtension(Class<?> target,
Object extensionObject) |
void |
setFieldValue(Object obj,
Field field,
Object value) |
getInstance, setInstancepublic static void registerFunction(Object target)
public static List<JavaInvoker<Method>> getFunctions()
public static JavaInvoker<Method> findMethodInvoker(List<JavaInvoker<Method>> methods, Class<?>[] parameterTypes)
public static JavaInvoker<Constructor> findConstructorInvoker(List<Constructor<?>> constructors, Class<?>[] parameterTypes)
public static <T extends Executable> JavaInvoker<T> findInvoker(List<JavaInvoker<T>> executables, Class<?>[] parameterTypes)
public static boolean isPrimitiveAssignableFrom(Class<?> from, Class<?> to)
Method.invoke(Object, Object...) method takes objects.public Field getField(Object obj, String name)
AbstractReflectiongetField 在类中 AbstractReflectionpublic void registerImplicitConvert(ClassImplicitConvert classImplicitConvert)
public void registerMethodExtension(Class<?> target, Object extensionObject)
public Object getFieldValue(Object obj, Field field)
AbstractReflectionAbstractReflection.getField(Object, String).getFieldValue 在类中 AbstractReflectionpublic void setFieldValue(Object obj, Field field, Object value)
setFieldValue 在类中 AbstractReflectionpublic JavaInvoker<Method> getExtensionMethod(Object obj, String name, Object... arguments)
public JavaInvoker<Method> getMethod(Object obj, String name, Object... arguments)
AbstractReflectionFunctionalInterface, the first declared method on the object is returned.getMethod 在类中 AbstractReflectionpublic JavaInvoker<Method> getFunction(String name, Object... arguments)
getFunction 在类中 AbstractReflectionCopyright © 2020–2021. All rights reserved.