Interface MethodAccessorFactory

    • Method Detail

      • registerGetterFor

        MethodDescription.InDefinedShape registerGetterFor​(FieldDescription fieldDescription,
                                                           MethodAccessorFactory.AccessType accessType)
        Registers a getter for the given FieldDescription which might itself not be accessible from outside the class. The returned getter method defines the field type as its return type, does not take any arguments and is of package-private visibility, similarly to the Java compiler's accessor methods. If the field is static, this accessor method is also static.
        Parameters:
        fieldDescription - The field which is to be accessed.
        accessType - The required access type.
        Returns:
        A getter method for the given field.
      • registerSetterFor

        MethodDescription.InDefinedShape registerSetterFor​(FieldDescription fieldDescription,
                                                           MethodAccessorFactory.AccessType accessType)
        Registers a setter for the given FieldDescription which might itself not be accessible from outside the class. The returned setter method defines the field type as its only argument type, returns void and is of package-private visibility, similarly to the Java compiler's accessor methods. If the field is static, this accessor method is also static.
        Parameters:
        fieldDescription - The field which is to be accessed.
        accessType - The required access type.
        Returns:
        A setter method for the given field.