Package org.eclipse.gef.common.reflect
Class ReflectionUtils
java.lang.Object
org.eclipse.gef.common.reflect.ReflectionUtils
Allows to access the value of private fields.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
getPrivateFieldValue
(Object owner, String fieldName) Returns the value of the specified private field for the given owner.static <T> void
setPrivateFieldValue
(Object owner, String fieldName, T value) Sets the value of the specified private field for the given owner to the given value.
-
Constructor Details
-
ReflectionUtils
public ReflectionUtils()
-
-
Method Details
-
getPrivateFieldValue
Returns the value of the specified private field for the given owner.- Type Parameters:
T
- The type of the field value.- Parameters:
owner
-Object
from which the field is read.fieldName
- Name of the field to read.- Returns:
- The value of the specified field for the given owner.
-
setPrivateFieldValue
Sets the value of the specified private field for the given owner to the given value.- Type Parameters:
T
- The type of the field value.- Parameters:
owner
-Object
for which the field is set.fieldName
- Name of the field.value
- New value for the field.
-