Package org.stianloader.micromixin.transform.internal.annotation

## Class MixinShadowAnnotation<T extends ClassMemberStub>

- java.lang.Object
- - org.stianloader.micromixin.transform.internal.annotation.MixinAnnotation<T>
  - - org.stianloader.micromixin.transform.internal.annotation.MixinShadowAnnotation<T>

- All Implemented Interfaces:
    `java.lang.Comparable<MixinAnnotation<T>>`

      public final class MixinShadowAnnotation<T extends ClassMemberStub>
      extends MixinAnnotation<T>

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `apply​(org.objectweb.asm.tree.ClassNode to, HandlerContextHelper hctx, MixinStub sourceStub, T source, SimpleRemapper remapper, java.lang.StringBuilder sharedBuilder)` |
    `void` | `collectMappings​(T source, HandlerContextHelper hctx, org.objectweb.asm.tree.ClassNode target, SimpleRemapper remapper, java.lang.StringBuilder sharedBuilder)` |
    `static <T0 extends ClassMemberStub> MixinShadowAnnotation<T0>` | `parse​(org.objectweb.asm.tree.AnnotationNode annotation, java.util.List<org.objectweb.asm.tree.AnnotationNode> allAnnotations, MixinLoggingFacade logger)` |
    `void` | `validateMixin​(T source, MixinLoggingFacade logger, java.lang.StringBuilder sharedBuilder)` | Validate the mixin annotation against the member the annotation was applied on.

    - ### Methods inherited from class org.stianloader.micromixin.transform.internal.annotation.MixinAnnotation

      `compareTo, isCompatible`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### parse

          @NotNull
          public static <T0 extends ClassMemberStub> MixinShadowAnnotation<T0> parse​(@NotNull
                                                                                     org.objectweb.asm.tree.AnnotationNode annotation,
                                                                                     @Nullable
                                                                                     java.util.List<org.objectweb.asm.tree.AnnotationNode> allAnnotations,
                                                                                     @NotNull
                                                                                     MixinLoggingFacade logger)

    - #### apply

          public void apply​(@NotNull
                            org.objectweb.asm.tree.ClassNode to,
                            @NotNull
                            HandlerContextHelper hctx,
                            @NotNull
                            MixinStub sourceStub,
                            @NotNull
                            T source,
                            @NotNull
                            SimpleRemapper remapper,
                            @NotNull
                            java.lang.StringBuilder sharedBuilder)

      Specified by:
        `apply` in class `MixinAnnotation<T extends ClassMemberStub>`

    - #### collectMappings

          public void collectMappings​(@NotNull
                                      T source,
                                      @NotNull
                                      HandlerContextHelper hctx,
                                      @NotNull
                                      org.objectweb.asm.tree.ClassNode target,
                                      @NotNull
                                      SimpleRemapper remapper,
                                      @NotNull
                                      java.lang.StringBuilder sharedBuilder)

      Specified by:
        `collectMappings` in class `MixinAnnotation<T extends ClassMemberStub>`

    - #### validateMixin

          public void validateMixin​(@NotNull
                                    T source,
                                    @NotNull
                                    MixinLoggingFacade logger,
                                    @NotNull
                                    java.lang.StringBuilder sharedBuilder)

      Description copied from class: `MixinAnnotation`
      Validate the mixin annotation against the member the annotation was applied on. This method will be called after all annotations on the member have been parsed, but the owner class may not have been parsed in it's entirety. The main purpose of this validation method is to catch obviously flawed mixin handlers as early as possible.

      As for larger modded environments this 'as early as possible' may in fact be too early and get drowned out by other log statements, any logging statements made while executing this method should be printed on application too, within reason (i.e. `MixinLoggingFacade.info(Class, String, Object...)` calls have no real reason to be repeated).

      Note that at the point this method is being called, micromixin-transformer has no knowledge of the class the mixin handler targets. If the target class or a member from there is required to be known during validation, such validation should be done within `MixinAnnotation.apply(ClassNode, HandlerContextHelper, MixinStub, Object, SimpleRemapper, StringBuilder)` or `MixinAnnotation.collectMappings(Object, HandlerContextHelper, ClassNode, SimpleRemapper, StringBuilder)`.

      Overrides:
        `validateMixin` in class `MixinAnnotation<T extends ClassMemberStub>`
      Parameters:
        `source` - The mixin handler source member which has this annotation annotated.
        `logger` - The logger to print warnings, errors or informational statements to.
        `sharedBuilder` - A shared `StringBuilder` instance that may be freely mutated (note: not thread-safe).