public class MixinTargetContext extends java.lang.Object implements IMixinContext
| Modifier and Type | Method and Description |
|---|---|
void |
applyInjections()
Apply injectors discovered in the
prepareInjections() pass |
ClassInfo |
findRealType(ClassInfo mixin)
Find the corresponding class type for the supplied mixin class in this
mixin target's hierarchy
|
java.util.List<org.spongepowered.asm.lib.tree.MethodNode> |
generateAccessors()
Expand accessor methods mixed into the target class by populating the
method bodies
|
protected ClassInfo |
getClassInfo()
Get the class info for this class
|
java.lang.String |
getClassName()
Get the mixin class name
|
org.spongepowered.asm.lib.tree.ClassNode |
getClassNode()
Get the mixin tree
|
java.lang.String |
getClassRef()
Get the internal class name
|
java.lang.String |
getDefaultInjectorGroup()
Get the defined injector group for injectors
|
int |
getDefaultRequiredInjections()
Get the defined value for the
Inject.require() parameter on
injectors defined in mixins in this configuration. |
MixinEnvironment |
getEnvironment()
Get the environment of the owning mixin config
|
Extensions |
getExtensions()
Get the mixin transformer extension manager
|
java.util.List<org.spongepowered.asm.lib.tree.FieldNode> |
getFields()
Get fields to mixin
|
InjectorGroupInfo.Map |
getInjectorGroups()
Get the injector groups for this target
|
java.util.Set<java.lang.String> |
getInterfaces()
Get all interfaces for this mixin
|
org.apache.logging.log4j.Level |
getLoggingLevel()
Get the logging level for this mixin
|
int |
getMaxShiftByValue()
Get the max shift "by" value for the parent config
|
java.util.List<org.spongepowered.asm.lib.tree.MethodNode> |
getMethods()
Get methods to mixin
|
int |
getMinRequiredClassVersion()
Get the minimum required class version for this mixin
|
IMixinInfo |
getMixin()
Get the mixin info
|
boolean |
getOption(MixinEnvironment.Option option)
Retrieve the value of the specified option from the environment
this mixin belongs to.
|
int |
getPriority()
Get the mixin priority
|
IReferenceMapper |
getReferenceMapper()
Get the reference mapper for this mixin
|
java.util.Set<java.util.Map.Entry<org.spongepowered.asm.lib.tree.FieldNode,org.spongepowered.asm.mixin.transformer.ClassInfo.Field>> |
getShadowFields()
Get shadow fields in this mixin
|
java.util.Collection<org.spongepowered.asm.lib.tree.MethodNode> |
getShadowMethods()
Get shadow methods in this mixin
|
ClassSignature |
getSignature()
Get the signature for this mixin class
|
java.lang.String |
getSourceFile()
Return the source file name for the mixin
|
SourceMap.File |
getStratum()
Get the SourceMap stratum for this mixin
|
org.spongepowered.asm.mixin.transformer.TargetClassContext |
getTarget()
Get the target class context
|
ClassInfo |
getTargetClassInfo()
Get the target classinfo
|
org.spongepowered.asm.lib.tree.ClassNode |
getTargetClassNode()
Get the target class
|
java.lang.String |
getTargetClassRef()
Get the target class reference
|
Target |
getTargetMethod(org.spongepowered.asm.lib.tree.MethodNode method)
Get a target method handle from the target class
|
java.lang.String |
getUniqueName(org.spongepowered.asm.lib.tree.FieldNode field)
Obtain a unique name for the specified field from the target class
context
|
java.lang.String |
getUniqueName(org.spongepowered.asm.lib.tree.MethodNode method,
boolean preservePrefix)
Obtain a unique name for the specified method from the target class
context
|
void |
postApply(java.lang.String transformedName,
org.spongepowered.asm.lib.tree.ClassNode targetClass)
Called immediately after the mixin is applied to targetClass
|
void |
preApply(java.lang.String transformedName,
org.spongepowered.asm.lib.tree.ClassNode targetClass)
Called immediately before the mixin is applied to targetClass
|
void |
prepareInjections()
Scans the target class for injector methods and prepares discovered
injectors
|
boolean |
requireOverwriteAnnotations()
Get whether overwrite annotations are required for methods in this mixin
|
protected void |
requireVersion(int version)
Mark this mixin as requiring the specified class version in the context
of the current target
|
boolean |
shouldSetSourceFile()
Get whether to propogate the source file attribute from a mixin onto the
target class
|
java.lang.String |
toString() |
void |
transformDescriptor(org.spongepowered.asm.lib.tree.FieldNode field)
Transforms a field descriptor in the context of this mixin target
|
void |
transformDescriptor(MemberRef member)
Transforms a method or field reference descriptor in the context of this
mixin target
|
void |
transformDescriptor(org.spongepowered.asm.lib.tree.MethodNode method)
Transforms a method descriptor in the context of this mixin target
|
void |
transformDescriptor(org.spongepowered.asm.lib.tree.TypeInsnNode typeInsn)
Transforms a type insn descriptor in the context of this mixin target
|
void |
transformMethod(org.spongepowered.asm.lib.tree.MethodNode method)
Handles "re-parenting" the method supplied, changes all references to the
mixin class to refer to the target class (for field accesses and method
invocations) and also handles fixing up the targets of INVOKESPECIAL
opcodes for mixins with detached targets.
|
protected void |
upgradeMethodRef(org.spongepowered.asm.lib.tree.MethodNode containingMethod,
MemberRef methodRef,
ClassInfo.Method method) |
protected void |
upgradeMethods() |
public java.lang.String toString()
toString in class java.lang.Objectpublic MixinEnvironment getEnvironment()
public boolean getOption(MixinEnvironment.Option option)
IMixinContextgetOption in interface IMixinContextoption - option to checkpublic org.spongepowered.asm.lib.tree.ClassNode getClassNode()
public java.lang.String getClassName()
getClassName in interface IMixinContextpublic java.lang.String getClassRef()
getClassRef in interface IMixinContextpublic org.spongepowered.asm.mixin.transformer.TargetClassContext getTarget()
public java.lang.String getTargetClassRef()
getTargetClassRef in interface IMixinContextpublic org.spongepowered.asm.lib.tree.ClassNode getTargetClassNode()
public ClassInfo getTargetClassInfo()
protected ClassInfo getClassInfo()
public ClassSignature getSignature()
public SourceMap.File getStratum()
public int getMinRequiredClassVersion()
public int getDefaultRequiredInjections()
Inject.require() parameter on
injectors defined in mixins in this configuration.public java.lang.String getDefaultInjectorGroup()
public int getMaxShiftByValue()
public InjectorGroupInfo.Map getInjectorGroups()
public boolean requireOverwriteAnnotations()
Overwritepublic ClassInfo findRealType(ClassInfo mixin)
mixin - Mixin class to discoverpublic void transformMethod(org.spongepowered.asm.lib.tree.MethodNode method)
method - Method to transformpublic void transformDescriptor(org.spongepowered.asm.lib.tree.FieldNode field)
field - Field node to transformpublic void transformDescriptor(org.spongepowered.asm.lib.tree.MethodNode method)
method - Method node to transformpublic void transformDescriptor(MemberRef member)
member - Reference to the method or fieldpublic void transformDescriptor(org.spongepowered.asm.lib.tree.TypeInsnNode typeInsn)
typeInsn - Type instruction node to transformpublic Target getTargetMethod(org.spongepowered.asm.lib.tree.MethodNode method)
getTargetMethod in interface IMixinContextmethod - method to get a target handle forprotected void requireVersion(int version)
version - version to requirepublic Extensions getExtensions()
IMixinContextgetExtensions in interface IMixinContextpublic IMixinInfo getMixin()
IMixinContextgetMixin in interface IMixinContextpublic int getPriority()
getPriority in interface IMixinContextpublic java.util.Set<java.lang.String> getInterfaces()
public java.util.Collection<org.spongepowered.asm.lib.tree.MethodNode> getShadowMethods()
public java.util.List<org.spongepowered.asm.lib.tree.MethodNode> getMethods()
public java.util.Set<java.util.Map.Entry<org.spongepowered.asm.lib.tree.FieldNode,org.spongepowered.asm.mixin.transformer.ClassInfo.Field>> getShadowFields()
public java.util.List<org.spongepowered.asm.lib.tree.FieldNode> getFields()
public org.apache.logging.log4j.Level getLoggingLevel()
public boolean shouldSetSourceFile()
public java.lang.String getSourceFile()
public IReferenceMapper getReferenceMapper()
IMixinContextgetReferenceMapper in interface IMixinContextpublic void preApply(java.lang.String transformedName,
org.spongepowered.asm.lib.tree.ClassNode targetClass)
transformedName - Target class's transformed nametargetClass - Target classpublic void postApply(java.lang.String transformedName,
org.spongepowered.asm.lib.tree.ClassNode targetClass)
transformedName - Target class's transformed nametargetClass - Target classpublic java.lang.String getUniqueName(org.spongepowered.asm.lib.tree.MethodNode method,
boolean preservePrefix)
method - method to obtain a name forpreservePrefix - true to preserve the method prefix (decorate as
postfix) otherwise decorates as infixpublic java.lang.String getUniqueName(org.spongepowered.asm.lib.tree.FieldNode field)
field - field to obtain a name forpublic void prepareInjections()
public void applyInjections()
prepareInjections() passpublic java.util.List<org.spongepowered.asm.lib.tree.MethodNode> generateAccessors()
protected void upgradeMethods()
protected void upgradeMethodRef(org.spongepowered.asm.lib.tree.MethodNode containingMethod,
MemberRef methodRef,
ClassInfo.Method method)