public class AccessorInfo extends SpecialMethodInfo
| Modifier and Type | Class and Description |
|---|---|
static class |
AccessorInfo.AccessorType
Accessor types
|
| Modifier and Type | Field and Description |
|---|---|
protected org.spongepowered.asm.lib.Type[] |
argTypes
Accessor method argument types (raw, from method)
|
protected static java.util.regex.Pattern |
PATTERN_ACCESSOR
Pattern for matching accessor names (for inflector)
|
protected org.spongepowered.asm.lib.Type |
returnType
Accessor method return type (raw, from method)
|
protected MemberInfo |
target
Computed information about the target field or method, name and
descriptor
|
protected org.spongepowered.asm.lib.tree.FieldNode |
targetField
For accessors, stores the discovered target field
|
protected org.spongepowered.asm.lib.tree.MethodNode |
targetMethod
For invokers, stores the discovered target method
|
protected AccessorInfo.AccessorType |
type
Type of accessor to generate, computed based on the signature of the
target method.
|
annotation, classNode, method, mixin| Modifier | Constructor and Description |
|---|---|
|
AccessorInfo(MixinTargetContext mixin,
org.spongepowered.asm.lib.tree.MethodNode method) |
protected |
AccessorInfo(MixinTargetContext mixin,
org.spongepowered.asm.lib.tree.MethodNode method,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass) |
| Modifier and Type | Method and Description |
|---|---|
protected <TNode> TNode |
findTarget(java.util.List<TNode> nodes)
Generified candidate search, since the search logic is the same for both
fields and methods.
|
org.spongepowered.asm.lib.tree.MethodNode |
generate()
Second pass, generate the actual accessor method for this accessor.
|
org.spongepowered.asm.lib.Type[] |
getArgTypes()
Get the argument types of the annotated method
|
org.spongepowered.asm.lib.Type |
getReturnType()
Get the return type of the annotated method
|
MemberInfo |
getTarget()
Get the inflected/specified target member for this accessor
|
org.spongepowered.asm.lib.tree.FieldNode |
getTargetField()
For field accessors, returns the target field, returns null for invokers
|
org.spongepowered.asm.lib.Type |
getTargetFieldType()
For field accessors, returns the field type, returns null for invokers
|
org.spongepowered.asm.lib.tree.MethodNode |
getTargetMethod()
For invokers, returns the target method, returns null for field accessors
|
protected java.lang.String |
getTargetName() |
protected java.lang.String |
inflectTarget()
Uses the name of this accessor method and the calculated accessor type to
try and inflect the name of the target field or method.
|
static java.lang.String |
inflectTarget(java.lang.String accessorName,
AccessorInfo.AccessorType accessorType,
java.lang.String accessorDescription,
IMixinContext context,
boolean verbose)
Uses the name of an accessor method and the accessor type to try and
inflect the name of the target field or method.
|
protected MemberInfo |
initTarget() |
protected org.spongepowered.asm.lib.Type |
initTargetFieldType() |
protected AccessorInfo.AccessorType |
initType() |
void |
locate()
First pass, locate the target field in the class.
|
static AccessorInfo |
of(MixinTargetContext mixin,
org.spongepowered.asm.lib.tree.MethodNode method,
java.lang.Class<? extends java.lang.annotation.Annotation> type)
Return a wrapper AccessorInfo of the correct type based on the method
passed in.
|
java.lang.String |
toString() |
getAnnotation, getClassNode, getContext, getMethodprotected static final java.util.regex.Pattern PATTERN_ACCESSOR
protected final org.spongepowered.asm.lib.Type[] argTypes
protected final org.spongepowered.asm.lib.Type returnType
protected final AccessorInfo.AccessorType type
protected final MemberInfo target
protected org.spongepowered.asm.lib.tree.FieldNode targetField
protected org.spongepowered.asm.lib.tree.MethodNode targetMethod
public AccessorInfo(MixinTargetContext mixin, org.spongepowered.asm.lib.tree.MethodNode method)
protected AccessorInfo(MixinTargetContext mixin, org.spongepowered.asm.lib.tree.MethodNode method, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
protected AccessorInfo.AccessorType initType()
protected org.spongepowered.asm.lib.Type initTargetFieldType()
protected MemberInfo initTarget()
protected java.lang.String getTargetName()
protected java.lang.String inflectTarget()
public static java.lang.String inflectTarget(java.lang.String accessorName,
AccessorInfo.AccessorType accessorType,
java.lang.String accessorDescription,
IMixinContext context,
boolean verbose)
accessorName - Name of the accessor methodaccessorType - Type of accessor being processed, this is calculated
from the method signature (void methods being setters,
methods with return types being getters)accessorDescription - description of the accessor to include in
error messagescontext - Mixin contextverbose - Emit warnings when accessor prefix doesn't match typepublic final MemberInfo getTarget()
public final org.spongepowered.asm.lib.Type getTargetFieldType()
public final org.spongepowered.asm.lib.tree.FieldNode getTargetField()
public final org.spongepowered.asm.lib.tree.MethodNode getTargetMethod()
public final org.spongepowered.asm.lib.Type getReturnType()
public final org.spongepowered.asm.lib.Type[] getArgTypes()
public java.lang.String toString()
toString in class java.lang.Objectpublic void locate()
public org.spongepowered.asm.lib.tree.MethodNode generate()
protected <TNode> TNode findTarget(java.util.List<TNode> nodes)
TNode - node typenodes - Node list to search (method/field list)public static AccessorInfo of(MixinTargetContext mixin, org.spongepowered.asm.lib.tree.MethodNode method, java.lang.Class<? extends java.lang.annotation.Annotation> type)
mixin - mixin context which owns this accessormethod - annotated methodtype - annotation type to process