Interface ISelectorContext
- All Known Subinterfaces:
IInjectionPointContext,ISliceContext
- All Known Implementing Classes:
AccessorInfo,AnnotatedMethodInfo,CallbackInjectionInfo,InjectionInfo,InjectionPointAnnotationContext,ModifyArgInjectionInfo,ModifyArgsInjectionInfo,ModifyConstantInjectionInfo,ModifyVariableInjectionInfo,RedirectInjectionInfo,SelectorAnnotationContext,SpecialMethodInfo
public interface ISelectorContext
Context passed to a
Target Selector in order to
support context-sensitive behaviour for the selector. For example obtaining
the name of the source mixin, or the element containing the selector itself.-
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 (outer/containing) context.Get 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.
-
Method Details
-
getParent
ISelectorContext getParent()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. -
getMixin
IMixinContext getMixin()Get the mixin containing this selector. -
getMethod
Object getMethod()Get the root method upon which this selector is operating, usually the injector method -
getAnnotation
IAnnotationHandle getAnnotation()Get the root annotation for the selector, for example the injector or accessor annotation -
getSelectorAnnotation
IAnnotationHandle getSelectorAnnotation()Get the annotation for this selector, for example the @At annotation -
getSelectorCoordinate
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.- Parameters:
leaf- True if getting the coordinate when this element is a leaf, false if getting the coordinate when it is a parent
-
remap
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.- Parameters:
reference- Reference to remap- Returns:
- Remapped reference or original reference if not remapped, must not return null!
-
getElementDescription
String getElementDescription()Get a human-readable description of the annotation on the method for use in error messages
-