Package py4j.reflection
Class ReflectionEngine
java.lang.Object
py4j.reflection.ReflectionEngine
The reflection engine is responsible for accessing the classes, the instances and members in a JVM.
- Author:
- Barthelemy Dagenais
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateArray
(String fqn, int[] dimensions) Class<?>
Class<?>[]
getClassParameters
(Object[] parameters) getConstructor
(Class<?> clazz, Class<?>[] parameters) getConstructor
(String classFQN, Object[] parameters) getFieldValue
(Object obj, Field field) Wrapper around Field.getString[]
Retrieve the names of all the public fields in the objString[]
Retrieve the names of all the public methods in the objString[]
getPublicStaticClassNames
(Class<?> clazz) Retrieve the names of all the public static classes in the clazzString[]
getPublicStaticFieldNames
(Class<?> clazz) Retrieve the names of all the public static fields in the clazzString[]
getPublicStaticMethodNames
(Class<?> clazz) Retrieve the names of all the public static methods in the clazzString[]
getPublicStaticNames
(Class<?> clazz) Retrieve the names of all the public static fields, methods and classes in the clazzinvoke
(Object object, MethodInvoker invoker, Object[] parameters) void
setFieldValue
(Object obj, Field field, Object value) Wrapper around Field.set
-
Field Details
-
cacheSize
public static final int cacheSize- See Also:
-
RETURN_VOID
-
-
Constructor Details
-
ReflectionEngine
public ReflectionEngine()
-
-
Method Details
-
createArray
-
getClass
-
getClassParameters
-
getConstructor
-
getConstructor
-
getField
- Parameters:
clazz
-name
-- Returns:
- The field or null if a field with this name does not exist in this class or in its hierarchy.
-
getField
- Parameters:
obj
-name
-- Returns:
- The field or null if a field with this name does not exist in the class of this object or in its hierarchy.
-
getField
-
getFieldValue
Wrapper around Field.get
- Parameters:
obj
-field
-- Returns:
-
getMethod
-
getMethod
-
getMethod
-
getMethod
-
invoke
-
setFieldValue
Wrapper around Field.set
- Parameters:
obj
-field
-value
-
-
getPublicMethodNames
Retrieve the names of all the public methods in the obj- Parameters:
obj
- the object to inspect- Returns:
- list of all the names of public methods in obj
-
getPublicFieldNames
Retrieve the names of all the public fields in the obj- Parameters:
obj
- the object to inspect- Returns:
- list of all the names of public fields in obj
-
getPublicStaticFieldNames
Retrieve the names of all the public static fields in the clazz- Parameters:
clazz
- the object to inspect- Returns:
- list of all the names of public statics
-
getPublicStaticMethodNames
Retrieve the names of all the public static methods in the clazz- Parameters:
clazz
- the object to inspect- Returns:
- list of all the names of public statics
-
getPublicStaticClassNames
Retrieve the names of all the public static classes in the clazz- Parameters:
clazz
- the object to inspect- Returns:
- list of all the names of public statics
-
getPublicStaticNames
Retrieve the names of all the public static fields, methods and classes in the clazz- Parameters:
clazz
- the object to inspect- Returns:
- list of all the names of public statics
-