Class SelectorAnnotationContext

  • All Implemented Interfaces:
    ISelectorContext
    Direct Known Subclasses:
    InjectionPointAnnotationContext

    public class SelectorAnnotationContext
    extends java.lang.Object
    implements ISelectorContext
    Narrowed context for selectors in annotations which are themselves inside a parent annotation, for example @At annotations within a parent @Inject annotation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IAnnotationHandle getAnnotation()
      Get the root annotation for the selector, for example the injector or accessor annotation
      java.lang.String getElementDescription()
      Get a human-readable description of the annotation on the method for use in error messages
      java.lang.Object getMethod()
      Get the root method upon which this selector is operating, usually the injector method
      IMixinContext getMixin()
      Get the mixin containing this selector.
      ISelectorContext getParent()
      Get the parent of this selector, must not return null
      IAnnotationHandle getSelectorAnnotation()
      Get the annotation for this selector, for example the @At annotation
      java.lang.String getSelectorCoordinate​(boolean leaf)
      Get the coordinate for this selector.
      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
    • Constructor Detail

      • SelectorAnnotationContext

        public SelectorAnnotationContext​(ISelectorContext parent,
                                         IAnnotationHandle selectorAnnotation,
                                         java.lang.String selectorCoordinate)
        Create a specialised context for a child annotation
        Parameters:
        parent - Parent selector context, eg. context of the outer element such as @Inject
        selectorAnnotation - Annotation for this selector, eg. @At
        selectorCoordinate - Coordinate for this selector
    • Method Detail

      • getMethod

        public java.lang.Object getMethod()
        Description copied from interface: ISelectorContext
        Get the root method upon which this selector is operating, usually the injector method
        Specified by:
        getMethod in interface ISelectorContext
      • getSelectorCoordinate

        public java.lang.String getSelectorCoordinate​(boolean leaf)
        Description copied from interface: ISelectorContext
        Get the coordinate for this selector. This is the local coordinate of the selector without any parent parts. Parent parts are prepended by consumers during the resolve process.
        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
      • 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!
      • getElementDescription

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