Class AnnotatedMethodInfo
java.lang.Object
org.spongepowered.asm.mixin.struct.AnnotatedMethodInfo
- All Implemented Interfaces:
IInjectionPointContext,ISelectorContext,IMessageSink
- Direct Known Subclasses:
SpecialMethodInfo
Data bundle for an annotated method in a mixin
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.objectweb.asm.tree.AnnotationNodeAnnotation on the methodprotected final StringHuman-readable annotation typeprotected final org.objectweb.asm.tree.MethodNodeAnnotated methodprotected final StringOriginal name of the method, if available -
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedMethodInfo(IMixinContext mixin, org.objectweb.asm.tree.MethodNode method, org.objectweb.asm.tree.AnnotationNode annotation) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(String format, Object... args) Add a new messagefinal IAnnotationHandleGet the primary annotation which makes this method specialorg.objectweb.asm.tree.AnnotationNodeGet the primary annotation which makes this method specialstatic final StringgetDynamicInfo(Object method) Get info from a decoratingDynamicannotation.static final StringgetDynamicInfo(org.objectweb.asm.tree.MethodNode method) Get info from a decoratingDynamicannotation.static final StringgetDynamicInfo(IAnnotatedElement method) Get info from a decoratingDynamicannotation.final StringGet a human-readable description of the annotation on the method for use in error messagesfinal org.objectweb.asm.tree.MethodNodeGet method being calledGet the original name of the method, if availablefinal IMixinContextgetMixin()Get the mixin target context for this annotated methodGet the parent (outer/containing) context.Get the annotation context for selectors operating in the context of this method.getSelectorCoordinate(boolean leaf) Get the selector coordinate for this methodRemap 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.
-
Field Details
-
method
protected final org.objectweb.asm.tree.MethodNode methodAnnotated method -
annotation
protected final org.objectweb.asm.tree.AnnotationNode annotationAnnotation on the method -
annotationType
Human-readable annotation type -
methodName
Original name of the method, if available
-
-
Constructor Details
-
AnnotatedMethodInfo
public AnnotatedMethodInfo(IMixinContext mixin, org.objectweb.asm.tree.MethodNode method, org.objectweb.asm.tree.AnnotationNode annotation)
-
-
Method Details
-
getElementDescription
Get a human-readable description of the annotation on the method for use in error messages- Specified by:
getElementDescriptionin interfaceISelectorContext
-
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!
-
getParent
Description copied from interface:ISelectorContextGet 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:
getParentin interfaceISelectorContext
-
getMixin
Get the mixin target context for this annotated method- Specified by:
getMixinin interfaceISelectorContext- Returns:
- the target context
-
getMethod
public final org.objectweb.asm.tree.MethodNode getMethod()Get method being called- Specified by:
getMethodin interfaceIInjectionPointContext- Specified by:
getMethodin interfaceISelectorContext- Returns:
- injector method
-
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:
getAnnotationNodein interfaceIInjectionPointContext
-
getAnnotation
Get the primary annotation which makes this method special- Specified by:
getAnnotationin interfaceISelectorContext- Returns:
- The primary method annotation
-
getSelectorAnnotation
Get the annotation context for selectors operating in the context of this method.- Specified by:
getSelectorAnnotationin interfaceISelectorContext- Returns:
- The selector context annotation
-
getSelectorCoordinate
Get the selector coordinate for this method- 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- Returns:
- The selector context annotation
-
addMessage
Description copied from interface:IMessageSinkAdd a new message- Specified by:
addMessagein interfaceIMessageSink- Parameters:
format- Message formatargs- Message args
-
getDynamicInfo
Get info from a decoratingDynamicannotation. 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
Get info from a decoratingDynamicannotation. 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
Get info from a decoratingDynamicannotation. 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
-