public class ExactReflection extends Object
| Modifier and Type | Method and Description |
|---|---|
ExactReflection |
forceAccess()
Retrieve an
ExactReflection object where scope restrictions are ignored. |
static ExactReflection |
fromClass(Class<?> source)
Retrieves an exact reflection instance from a given class.
|
static ExactReflection |
fromClass(Class<?> source,
boolean forceAccess)
Retrieves an exact reflection instance from a given class.
|
static ExactReflection |
fromObject(Object reference)
Retrieves an exact reflection instance from an object.
|
static ExactReflection |
fromObject(Object reference,
boolean forceAccess)
Retrieves an exact reflection instance from an object.
|
Field |
getField(String fieldName)
Retrieve a field in the class hierachy by the given name.
|
Method |
getMethod(String methodName,
Class<?>... parameters)
Retrieve the first method in the class hierachy with the given name and parameters.
|
Class<?> |
getSource()
Retrieve the source class we are searching.
|
boolean |
isForceAccess()
Determine if we are overriding scope restrictions and will also find
private, protected or package members.
|
public static ExactReflection fromClass(Class<?> source)
source - - the class we'll use.public static ExactReflection fromClass(Class<?> source, boolean forceAccess)
source - - the class we'll use.forceAccess - - whether or not to override scope restrictions.public static ExactReflection fromObject(Object reference)
reference - - the object we'll use.public static ExactReflection fromObject(Object reference, boolean forceAccess)
reference - - the object we'll use.forceAccess - - whether or not to override scope restrictions.public Method getMethod(String methodName, Class<?>... parameters)
If isForceAccess() is TRUE, we will also search for protected and private methods.
methodName - - the method name to find, or NULL to look for everything.parameters - - the parameters.IllegalArgumentException - If we cannot find a method by this name.public Field getField(String fieldName)
If isForceAccess() is TRUE, we will also search for protected and private fields.
fieldName - - the field name. Cannot be NULL.public ExactReflection forceAccess()
ExactReflection object where scope restrictions are ignored.public boolean isForceAccess()
public Class<?> getSource()
Copyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.