-
public final class ReflectUtilsauthor: Blankj blog : http://blankj.com time : 2017/12/15 desc : utils about reflect
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classReflectUtils.ReflectException
-
Method Summary
Modifier and Type Method Description static ReflectUtilsreflect(String className)Reflect the class. static ReflectUtilsreflect(String className, ClassLoader classLoader)Reflect the class. static ReflectUtilsreflect(Class<out Object> clazz)Reflect the class. static ReflectUtilsreflect(Object object)Reflect the class. ReflectUtilsnewInstance()Create and initialize a new instance. ReflectUtilsnewInstance(Array<Object> args)Create and initialize a new instance. ReflectUtilsfield(String name)Get the field. ReflectUtilsfield(String name, Object value)Set the field. ReflectUtilsmethod(String name)Invoke the method. ReflectUtilsmethod(String name, Array<Object> args)Invoke the method. <P> Pproxy(Class<P> proxyType)Create a proxy for the wrapped object allowing to typesafely invokemethods on it using a custom interface. <T> Tget()Get the result. inthashCode()booleanequals(Object obj)StringtoString()-
-
Method Detail
-
reflect
static ReflectUtils reflect(String className)
Reflect the class.
- Parameters:
className- The name of class.
-
reflect
static ReflectUtils reflect(String className, ClassLoader classLoader)
Reflect the class.
- Parameters:
className- The name of class.classLoader- The loader of class.
-
reflect
static ReflectUtils reflect(Class<out Object> clazz)
Reflect the class.
- Parameters:
clazz- The class.
-
reflect
static ReflectUtils reflect(Object object)
Reflect the class.
- Parameters:
object- The object.
-
newInstance
ReflectUtils newInstance()
Create and initialize a new instance.
-
newInstance
ReflectUtils newInstance(Array<Object> args)
Create and initialize a new instance.
- Parameters:
args- The args.
-
field
ReflectUtils field(String name)
Get the field.
- Parameters:
name- The name of field.
-
field
ReflectUtils field(String name, Object value)
Set the field.
- Parameters:
name- The name of field.value- The value.
-
method
ReflectUtils method(String name)
Invoke the method.
- Parameters:
name- The name of method.
-
method
ReflectUtils method(String name, Array<Object> args)
Invoke the method.
- Parameters:
name- The name of method.args- The args.
-
proxy
<P> P proxy(Class<P> proxyType)
Create a proxy for the wrapped object allowing to typesafely invokemethods on it using a custom interface.
- Parameters:
proxyType- The interface type that is implemented by the proxy.
-
hashCode
int hashCode()
-
-
-
-