Interface FieldAccessor


public interface FieldAccessor
Represents an interface for accessing a field.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final FieldAccessor
    NoOp Accessor, does what is says: nothing.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(Object instance)
    Retrieve the value of a field for a particular instance.
    Retrieve the underlying field.
    void
    set(Object instance, Object value)
    Set the value of a field for a particular instance.
  • Field Details

    • NO_OP_ACCESSOR

      static final FieldAccessor NO_OP_ACCESSOR
      NoOp Accessor, does what is says: nothing.
  • Method Details

    • get

      Object get(Object instance)
      Retrieve the value of a field for a particular instance.
      Parameters:
      instance - - the instance, or NULL for a static field.
      Returns:
      The value of the field.
      Throws:
      IllegalStateException - If the current security context prohibits reflection.
    • set

      void set(Object instance, Object value)
      Set the value of a field for a particular instance.
      Parameters:
      instance - - the instance, or NULL for a static field.
      value - - the new value of the field.
    • getField

      Field getField()
      Retrieve the underlying field.
      Returns:
      The field.