Package ghidra.pyghidra
Class PythonFieldExposer.ExposedField
java.lang.Object
ghidra.pyghidra.PythonFieldExposer.ExposedField
- Enclosing interface:
PythonFieldExposer
Base class for making a protected field accessible from Python.
Child classes are to be defined inside the class containing the fields to be exposed.
The only requirement of the child class is to provide a
MethodHandles.Lookup
with access
to the protected fields, to the PythonFieldExposer.ExposedField
constructor as shown below.
public class ExampleClass implements PythonFieldExposer {
protected int counter = 0;
private static class ExposedField extends PythonFieldExposer.ExposedField {
public ExposedField(String name, Class<?> type) {
super(MethodHandles.lookup().in(ExampleClass.class), name, type);
}
}
}
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ExposedField
(MethodHandles.Lookup lookup, String name, Class<?> type) Constructs a newPythonFieldExposer.ExposedField
-
Method Summary
-
Constructor Details
-
ExposedField
Constructs a newPythonFieldExposer.ExposedField
- Parameters:
lookup
- theMethodHandles.Lookup
with access to the protected fieldname
- the name of the protected fieldtype
- the type of the protected field
-
-
Method Details
-
fget
Gets the field value- Parameters:
self
- the instance containing the field- Returns:
- the field value
-
fset
Sets the field value- Parameters:
self
- the instance containing the fieldvalue
- the field value
-