Class PythonFieldExposer.ExposedField

java.lang.Object
ghidra.pyghidra.PythonFieldExposer.ExposedField
Enclosing interface:
PythonFieldExposer

public abstract static class PythonFieldExposer.ExposedField extends Object
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 Details

  • Method Details

    • fget

      public final Object fget(Object self)
      Gets the field value
      Parameters:
      self - the instance containing the field
      Returns:
      the field value
    • fset

      public final void fset(Object self, Object value)
      Sets the field value
      Parameters:
      self - the instance containing the field
      value - the field value