Enum Class AccessorType

java.lang.Object
java.lang.Enum<AccessorType>
org.cadixdev.mercury.mixin.annotation.AccessorType
All Implemented Interfaces:
Serializable, Comparable<AccessorType>, Constable

public enum AccessorType extends Enum<AccessorType>
The type of accessor.
Since:
0.1.0
  • Enum Constant Details

    • FIELD_GETTER

      public static final AccessorType FIELD_GETTER
      A field getter, accessor must accept no args and return field type
    • FIELD_SETTER

      public static final AccessorType FIELD_SETTER
      A field setter, accessor must accept single arg of the field type and return void
    • METHOD_PROXY

      public static final AccessorType METHOD_PROXY
      An invoker (proxy) method
    • OBJECT_FACTORY

      public static final AccessorType OBJECT_FACTORY
      An invoker (proxy) method
  • Method Details

    • values

      public static AccessorType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AccessorType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPrefixes

      public String[] getPrefixes()
      Gets all of the expected prefixes for this accessor type.
      Returns:
      The expected prefixes
    • isExpectedPrefix

      public boolean isExpectedPrefix(String prefix)
      Checks if the given prefix is a expected for this accessor type.
      Parameters:
      prefix - The prefix to check
      Returns:
      true if the prefix is expected for this type
    • get

      public static AccessorType get(boolean isInvoker, org.cadixdev.mercury.shadow.org.eclipse.jdt.core.dom.IMethodBinding binding, org.cadixdev.bombe.type.signature.MethodSignature signature, AccessorData data)
      Gets the accessor type for the given accessor (or invoker).
      Parameters:
      isInvoker - Whether the accessor is a invoker
      binding - The accessor method binding
      signature - The accessor method signature (name and descriptor)
      data - The accessor data
      Returns:
      The type of the accessor