Class MixinAnnotation<T>

    • Constructor Detail

      • MixinAnnotation

        public MixinAnnotation()
    • Method Detail

      • apply

        public abstract 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)
      • collectMappings

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

        public int compareTo​(MixinAnnotation<T> o)
        Specified by:
        compareTo in interface java.lang.Comparable<T>
      • isCompatible

        @Deprecated
        public boolean isCompatible​(java.util.Collection<MixinAnnotation<T>> collection)
        Deprecated.
      • validateMixin

        public void validateMixin​(@NotNull
                                  T source,
                                  @NotNull
                                  MixinLoggingFacade logger,
                                  @NotNull
                                  java.lang.StringBuilder sharedBuilder)
        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 apply(ClassNode, HandlerContextHelper, MixinStub, Object, SimpleRemapper, StringBuilder) or collectMappings(Object, HandlerContextHelper, ClassNode, SimpleRemapper, StringBuilder).

        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).