Package bridge

Class Invocation

java.lang.Object
bridge.Invocation

public final class Invocation extends Object
A class that can be used to access field & method bridges (and other things too)
Notes:
Imaginary objects defined within and returned by this class may not be stored. In other words, you are required to use them in the same statement they were created in for your code to compile correctly.
  • Field Details

    • LANGUAGE_LEVEL

      public static final int LANGUAGE_LEVEL
      Creates fork(s) of your class with code tailored to the specified Java language level(s)
      Notes:
      This constant may only appear in integer comparisons as the first operand. Using it anywhere else will not compile correctly.
  • Constructor Details

    • Invocation

      public Invocation(Class<?> type)
      Starts a direct reference to something static
      Parameters:
      type - Type constant – no dynamic values are permitted here.
    • Invocation

      public Invocation(String type)
      Starts a direct reference to something static
      Parameters:
      type - Type name constant – no dynamic values or string manipulation is permitted here.
    • Invocation

      public Invocation(@Polymorphic Object instance)
      Starts a direct reference to something that belongs to an instance of an object
      Parameters:
      instance - Object instance
      Notes:
      Calling this overload will cause the object type to be determined automatically.
    • Invocation

      public Invocation(Class<?> type, Object instance)
      Starts a direct reference to something that belongs to an instance of an object
      Parameters:
      type - Type constant – no dynamic values are permitted here.
      instance - Object instance
    • Invocation

      public Invocation(String type, Object instance)
      Starts a direct reference to something that belongs to an instance of an object
      Parameters:
      type - Type name constant – no dynamic values or string manipulation is permitted here.
      instance - Object instance
  • Method Details

    • ofClassLiteral

      public Class<?> ofClassLiteral()
      Creates a direct reference to a class
      Returns:
      An actual class reference.
    • ofInstanceOf

      public boolean ofInstanceOf()
      Creates a direct type-compatibility check
      Returns:
      The actual boolean response.
      Notes:
      This operation requires instance access.
    • ofConstructor

      public Invocation.Executor ofConstructor()
      Creates a direct reference to a constructor
      Returns:
      An imaginary reference for you to execute your request with.
      Notes:
      This operation requires static access.
    • ofMethod

      public Invocation.Executor ofMethod(String name)
      Creates a direct reference to a method
      Parameters:
      name - Method name constant – no dynamic values or string manipulation is permitted here.
      Returns:
      An imaginary reference for you to execute your request with.
      Notes:
      Calling this overload will cause the method return type to be determined automatically.
    • ofMethod

      public Invocation.Executor ofMethod(Class<?> type, String name)
      Creates a direct reference to a method
      Parameters:
      type - Method return type constant – no dynamic values are permitted here.
      name - Method name constant – no dynamic values or string manipulation is permitted here.
      Returns:
      An imaginary reference for you to execute your request with.
    • ofMethod

      public Invocation.Executor ofMethod(String type, String name)
      Creates a direct reference to a method
      Parameters:
      type - Method return type name constant – no dynamic values or string manipulation is permitted here.
      name - Method name constant – no dynamic values or string manipulation is permitted here.
      Returns:
      An imaginary reference for you to execute your request with.
    • ofField

      public Invocation.Accessor ofField(String name)
      Creates a direct reference to a field
      Parameters:
      name - Field name constant – no dynamic values or string manipulation is permitted here.
      Returns:
      An imaginary reference for you to execute your request with.
      Notes:
      Calling this overload will cause the field type to be determined automatically.
    • ofField

      public Invocation.Accessor ofField(Class<?> type, String name)
      Creates a direct reference to a field
      Parameters:
      type - Field type constant – no dynamic values are permitted here.
      name - Field name constant – no dynamic values or string manipulation is permitted here.
      Returns:
      An imaginary reference for you to execute your request with.
    • ofField

      public Invocation.Accessor ofField(String type, String name)
      Creates a direct reference to a field
      Parameters:
      type - Field type name constant – no dynamic values or string manipulation is permitted here.
      name - Field name constant – no dynamic values or string manipulation is permitted here.
      Returns:
      An imaginary reference for you to execute your request with.