Annotation Type Target


  • @Retention(CLASS)
    @Repeatable(List.class)
    @Target(METHOD)
    public @interface Target
    Marks a method as the target method. The method annotated with this, called "stub" within the documentation, should have the same name and parameters as the method it's supposed to represent. It will be discarded unless the containing class is annotated with Patch and at least another method within the class is annotated with Injector.
    See Also:
    Patch, Injector
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String of
      Indicates which of the methods annotated with Find or Injector is targeting this stub.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean bridge
      When set to true, tells the processor to match the synthetic "bridge" method generated by the compiler to handle type erasure.
      java.lang.String methodName  
      boolean strict
      When set to false, tells the processor to first try to match a single method by name, and to only check parameters if further clarification is needed.
    • Element Detail

      • of

        java.lang.String of
        Indicates which of the methods annotated with Find or Injector is targeting this stub.
        Returns:
        the name of the element this is supposed to apply to
        Since:
        0.5.0
      • methodName

        java.lang.String methodName
        Returns:
        a name which overrides the name of the annotated one, may be used in cases such as constructors
        Since:
        0.5.0
        Default:
        ""
      • strict

        boolean strict
        When set to false, tells the processor to first try to match a single method by name, and to only check parameters if further clarification is needed. While non-strict mode is more computationally efficient, it's ultimately not relevant, as it only matters at compile time. Do not set this to false unless you know what you're doing.
        Returns:
        whether strict mode is to be used
        Since:
        0.3.0
        Default:
        true
      • bridge

        boolean bridge
        When set to true, tells the processor to match the synthetic "bridge" method generated by the compiler to handle type erasure.
        Returns:
        whether the bridge method should be targeted instead of the actual method
        Since:
        0.5.2
        Default:
        false