public abstract class AbstractReflection extends Object
AstInterpreter to access fields and methods of objects. This is a singleton class used by all
AstInterpreter instances. Replace the default implementation via setInstance(AbstractReflection). The implementation
must be thread-safe.| 构造器和说明 |
|---|
AbstractReflection() |
| 限定符和类型 | 方法和说明 |
|---|---|
abstract 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
|
abstract Object |
getFieldValue(Object obj,
Field field)
Returns the value of the field from the object.
|
abstract JavaInvoker<Method> |
getFunction(String name,
Object... arguments) |
static AbstractReflection |
getInstance()
Returns the Reflection instance used to fetch field and call methods
|
abstract 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.
|
abstract void |
registerImplicitConvert(ClassImplicitConvert classImplicitConvert) |
abstract void |
registerMethodExtension(Class<?> target,
Object extensionObject) |
abstract void |
setFieldValue(Object obj,
Field field,
Object value) |
static void |
setInstance(AbstractReflection abstractReflection)
Sets the Reflection instance to be used by all Template interpreters
|
public static AbstractReflection getInstance()
public static void setInstance(AbstractReflection abstractReflection)
public abstract Field getField(Object obj, String name)
public abstract JavaInvoker<Method> getMethod(Object obj, String name, Object... arguments)
FunctionalInterface, the first declared method on the object is returned.public abstract JavaInvoker<Method> getFunction(String name, Object... arguments)
public abstract void registerMethodExtension(Class<?> target, Object extensionObject)
public abstract void registerImplicitConvert(ClassImplicitConvert classImplicitConvert)
public abstract Object getFieldValue(Object obj, Field field)
getField(Object, String).Copyright © 2020–2021. All rights reserved.