Annotation Type Mixin


@Target(TYPE)
@Retention(CLASS)
public @interface Mixin
Decorator for mixin classes
  • Optional Element Summary

    Optional Elements
    Modifier and Type Optional Element Description
    int priority
    Priority for the mixin, relative to other mixins targetting the same classes
    boolean remap
    By default, the annotation processor will attempt to locate an obfuscation mapping for all Shadow and Inject annotated members since it is anticipated that in general the target of a Mixin will be an obfuscated class and all annotated members will need to be added to the obfuscation table.
    java.lang.String[] targets
    Since specifying targets in value() requires that the classes be publicly visible, this property is provided to allow package-private, anonymous innner, and private inner classes to be referenced.
    java.lang.Class<?>[] value
    Target class(es) for this mixin
  • Element Details

    • value

      java.lang.Class<?>[] value
      Target class(es) for this mixin
      Returns:
      classes this mixin targets
      Default:
      {}
    • targets

      java.lang.String[] targets
      Since specifying targets in value() requires that the classes be publicly visible, this property is provided to allow package-private, anonymous innner, and private inner classes to be referenced. Referencing an otherwise public class using this property is an error condition and will throw an exception at runtime. It is completely fine to specify both public and private targets for the same mixin however.
      Returns:
      protected or package-private classes this mixin targets
      Default:
      {}
    • priority

      int priority
      Priority for the mixin, relative to other mixins targetting the same classes
      Returns:
      the mixin priority (relative to other mixins targetting the same class)
      Default:
      1000
    • remap

      boolean remap
      By default, the annotation processor will attempt to locate an obfuscation mapping for all Shadow and Inject annotated members since it is anticipated that in general the target of a Mixin will be an obfuscated class and all annotated members will need to be added to the obfuscation table. However since it is possible to also apply mixins to non-obfuscated targets it may be desirable to suppress the compiler warnings which would otherwise be generated. This can be done on an individual member basis by setting remap to false on the individual annotations, or disabled for the entire mixin by setting the value here to false. Doing so will cause the annotation processor to skip all annotations in this mixin when building the obfuscation table unless the individual annotation is explicitly decorated with remap = true.
      Returns:
      True to instruct the annotation processor to search for obfuscation mappings for this annotation (default true).
      Default:
      true