Class AnnotatedMethodInfo

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.objectweb.asm.tree.AnnotationNode annotation
      Annotation on the method
      protected java.lang.String annotationType
      Human-readable annotation type
      protected org.objectweb.asm.tree.MethodNode method
      Annotated method
      protected java.lang.String methodName
      Original name of the method, if available
    • Constructor Summary

      Constructors 
      Constructor Description
      AnnotatedMethodInfo​(IMixinContext mixin, org.objectweb.asm.tree.MethodNode method, org.objectweb.asm.tree.AnnotationNode annotation)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addMessage​(java.lang.String format, java.lang.Object... args)
      Add a new message
      IAnnotationHandle getAnnotation()
      Get the primary annotation which makes this method special
      org.objectweb.asm.tree.AnnotationNode getAnnotationNode()
      Get the primary annotation which makes this method special
      static java.lang.String getDynamicInfo​(java.lang.Object method)
      Get info from a decorating Dynamic annotation.
      static java.lang.String getDynamicInfo​(org.objectweb.asm.tree.MethodNode method)
      Get info from a decorating Dynamic annotation.
      static java.lang.String getDynamicInfo​(IAnnotatedElement method)
      Get info from a decorating Dynamic annotation.
      java.lang.String getElementDescription()
      Get a human-readable description of the annotation on the method for use in error messages
      org.objectweb.asm.tree.MethodNode getMethod()
      Get method being called
      java.lang.String getMethodName()
      Get the original name of the method, if available
      IMixinContext getMixin()
      Get the mixin target context for this annotated method
      ISelectorContext getParent()
      Get the parent (outer/containing) context.
      IAnnotationHandle getSelectorAnnotation()
      Get the annotation context for selectors operating in the context of this method.
      java.lang.String getSelectorCoordinate​(boolean leaf)
      Get the selector coordinate for this method
      java.lang.String remap​(java.lang.String reference)
      Remap a reference in the context of this selector, usually via the local refmap of the mixin configuration but can be overridden as needed, for example to provide selector-local remap behaviour.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • method

        protected final org.objectweb.asm.tree.MethodNode method
        Annotated method
      • annotation

        protected final org.objectweb.asm.tree.AnnotationNode annotation
        Annotation on the method
      • annotationType

        protected final java.lang.String annotationType
        Human-readable annotation type
      • methodName

        protected final java.lang.String methodName
        Original name of the method, if available
    • Constructor Detail

      • AnnotatedMethodInfo

        public AnnotatedMethodInfo​(IMixinContext mixin,
                                   org.objectweb.asm.tree.MethodNode method,
                                   org.objectweb.asm.tree.AnnotationNode annotation)
    • Method Detail

      • getElementDescription

        public final java.lang.String getElementDescription()
        Get a human-readable description of the annotation on the method for use in error messages
        Specified by:
        getElementDescription in interface ISelectorContext
      • remap

        public java.lang.String remap​(java.lang.String reference)
        Description copied from interface: ISelectorContext
        Remap a reference in the context of this selector, usually via the local refmap of the mixin configuration but can be overridden as needed, for example to provide selector-local remap behaviour.
        Specified by:
        remap in interface ISelectorContext
        Parameters:
        reference - Reference to remap
        Returns:
        Remapped reference or original reference if not remapped, must not return null!
      • getParent

        public ISelectorContext getParent()
        Description copied from interface: ISelectorContext
        Get the parent (outer/containing) context. Can be null if this is a root element such as an injector method, in which case the parent is the mixin instead.
        Specified by:
        getParent in interface ISelectorContext
      • getMixin

        public final IMixinContext getMixin()
        Get the mixin target context for this annotated method
        Specified by:
        getMixin in interface ISelectorContext
        Returns:
        the target context
      • getMethodName

        public java.lang.String getMethodName()
        Get the original name of the method, if available
      • getAnnotationNode

        public org.objectweb.asm.tree.AnnotationNode getAnnotationNode()
        Get the primary annotation which makes this method special
        Specified by:
        getAnnotationNode in interface IInjectionPointContext
      • getSelectorCoordinate

        public java.lang.String getSelectorCoordinate​(boolean leaf)
        Get the selector coordinate for this method
        Specified by:
        getSelectorCoordinate in interface ISelectorContext
        Parameters:
        leaf - True if getting the coordinate when this element is a leaf, false if getting the coordinate when it is a parent
        Returns:
        The selector context annotation
      • addMessage

        public void addMessage​(java.lang.String format,
                               java.lang.Object... args)
        Description copied from interface: IMessageSink
        Add a new message
        Specified by:
        addMessage in interface IMessageSink
        Parameters:
        format - Message format
        args - Message args
      • getDynamicInfo

        public static final java.lang.String getDynamicInfo​(java.lang.Object method)
        Get info from a decorating Dynamic annotation. If the annotation is present, a descriptive string suitable for inclusion in an error message is returned. If the annotation is not present then an empty string is returned.
        Parameters:
        method - method to inspect
      • getDynamicInfo

        public static final java.lang.String getDynamicInfo​(org.objectweb.asm.tree.MethodNode method)
        Get info from a decorating Dynamic annotation. If the annotation is present, a descriptive string suitable for inclusion in an error message is returned. If the annotation is not present then an empty string is returned.
        Parameters:
        method - method to inspect
      • getDynamicInfo

        public static final java.lang.String getDynamicInfo​(IAnnotatedElement method)
        Get info from a decorating Dynamic annotation. If the annotation is present, a descriptive string suitable for inclusion in an error message is returned. If the annotation is not present then an empty string is returned.
        Parameters:
        method - method to inspect