Class SelectorAnnotationContext
java.lang.Object
org.spongepowered.asm.mixin.injection.struct.SelectorAnnotationContext
- All Implemented Interfaces:
ISelectorContext
- Direct Known Subclasses:
InjectionPointAnnotationContext
Narrowed context for selectors in annotations which are themselves inside
a parent annotation, for example @At annotations within a parent
@Inject annotation.
-
Constructor Summary
ConstructorsConstructorDescriptionSelectorAnnotationContext(ISelectorContext parent, IAnnotationHandle selectorAnnotation, String selectorCoordinate) Create a specialised context for a child annotation -
Method Summary
Modifier and TypeMethodDescriptionGet the root annotation for the selector, for example the injector or accessor annotationGet a human-readable description of the annotation on the method for use in error messagesGet the root method upon which this selector is operating, usually the injector methodgetMixin()Get the mixin containing this selector.Get the parent of this selector, must not return nullGet the annotation for this selector, for example the @At annotationgetSelectorCoordinate(boolean leaf) Get the coordinate for this selector.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.
-
Constructor Details
-
SelectorAnnotationContext
public SelectorAnnotationContext(ISelectorContext parent, IAnnotationHandle selectorAnnotation, String selectorCoordinate) Create a specialised context for a child annotation- Parameters:
parent- Parent selector context, eg. context of the outer element such as @InjectselectorAnnotation- Annotation for this selector, eg. @AtselectorCoordinate- Coordinate for this selector
-
-
Method Details
-
getParent
Get the parent of this selector, must not return null- Specified by:
getParentin interfaceISelectorContext- Returns:
- parent context
-
getMixin
Description copied from interface:ISelectorContextGet the mixin containing this selector.- Specified by:
getMixinin interfaceISelectorContext
-
getMethod
Description copied from interface:ISelectorContextGet the root method upon which this selector is operating, usually the injector method- Specified by:
getMethodin interfaceISelectorContext
-
getAnnotation
Description copied from interface:ISelectorContextGet the root annotation for the selector, for example the injector or accessor annotation- Specified by:
getAnnotationin interfaceISelectorContext
-
getSelectorAnnotation
Description copied from interface:ISelectorContextGet the annotation for this selector, for example the @At annotation- Specified by:
getSelectorAnnotationin interfaceISelectorContext
-
getSelectorCoordinate
Description copied from interface:ISelectorContextGet 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:
getSelectorCoordinatein interfaceISelectorContext- Parameters:
leaf- True if getting the coordinate when this element is a leaf, false if getting the coordinate when it is a parent
-
remap
Description copied from interface:ISelectorContextRemap 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:
remapin interfaceISelectorContext- Parameters:
reference- Reference to remap- Returns:
- Remapped reference or original reference if not remapped, must not return null!
-
getElementDescription
Description copied from interface:ISelectorContextGet a human-readable description of the annotation on the method for use in error messages- Specified by:
getElementDescriptionin interfaceISelectorContext
-