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

## Class VirtualConstructorMergeAnnotation

- java.lang.Object
- - org.stianloader.micromixin.transform.internal.annotation.MixinAnnotation<MixinMethodStub>
  - - org.stianloader.micromixin.transform.internal.annotation.VirtualConstructorMergeAnnotation

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

      public class VirtualConstructorMergeAnnotation
      extends MixinAnnotation<MixinMethodStub>

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `VirtualConstructorMergeAnnotation​(MixinVendor vendorCompat, boolean matchAny, MixinLoggingFacade logger)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `apply​(org.objectweb.asm.tree.ClassNode to, HandlerContextHelper hctx, MixinStub sourceStub, MixinMethodStub source, SimpleRemapper remapper, java.lang.StringBuilder sharedBuilder)` |
    `void` | `collectMappings​(MixinMethodStub source, HandlerContextHelper hctx, org.objectweb.asm.tree.ClassNode target, SimpleRemapper remapper, java.lang.StringBuilder sharedBuilder)` |
    `void` | `validateMixin​(MixinMethodStub 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`

- - ### Constructor Detail

    - #### VirtualConstructorMergeAnnotation

          public VirtualConstructorMergeAnnotation​(@Nullable
                                                   MixinVendor vendorCompat,
                                                   boolean matchAny,
                                                   @NotNull
                                                   MixinLoggingFacade logger)

  - ### Method Detail

    - #### apply

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

      Specified by:
        `apply` in class `MixinAnnotation<MixinMethodStub>`

    - #### collectMappings

          public void collectMappings​(@NotNull
                                      MixinMethodStub 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<MixinMethodStub>`

    - #### validateMixin

          public void validateMixin​(@NotNull
                                    MixinMethodStub 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<MixinMethodStub>`
      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).