Class InsnListEx
- java.lang.Object
-
- org.objectweb.asm.tree.InsnList
-
- org.spongepowered.asm.mixin.injection.code.InsnListReadOnly
-
- org.spongepowered.asm.mixin.injection.code.InsnListEx
-
- All Implemented Interfaces:
java.lang.Iterable<org.objectweb.asm.tree.AbstractInsnNode>,IInsnListEx
public class InsnListEx extends InsnListReadOnly implements IInsnListEx
InsnList with extensions, seeIInsnListEx
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.asm.mixin.injection.code.IInsnListEx
IInsnListEx.SpecialNodeType
-
-
Constructor Summary
Constructors Constructor Description InsnListEx(Target target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> InsnListExdecorate(java.lang.String key, V value)Decorate this insn list with arbitrary metadata for use by context-specific injection points<V> VgetDecoration(java.lang.String key)Get the specified decoration<V> VgetDecoration(java.lang.String key, V defaultValue)Get the specified decoration or default valueorg.objectweb.asm.tree.AbstractInsnNodegetSpecialNode(IInsnListEx.SpecialNodeType type)Get - if available - the specified special node from the target.intgetTargetAccess()Get the access flags from the target methodjava.lang.StringgetTargetDesc()Get the descriptor of the target methodjava.lang.StringgetTargetName()Get the name of the target methodjava.lang.StringgetTargetSignature()Get the signature of the target methodbooleanhasDecoration(java.lang.String key)Get whether this list is decorated with the specified keybooleanisTargetConstructor()Get whether the target method is a constructorbooleanisTargetStatic()Get whether the target method is staticbooleanisTargetStaticInitialiser()Get whether the target method is a static initialiserjava.lang.StringtoString()InsnListExundecorate()Strip all decorations from this listInsnListExundecorate(java.lang.String key)Strip a specific decoration from this list if the decoration exists-
Methods inherited from class org.spongepowered.asm.mixin.injection.code.InsnListReadOnly
add, add, contains, get, getFirst, getLast, indexOf, insert, insert, insert, insert, insertBefore, insertBefore, iterator, iterator, remove, resetLabels, set, size, toArray
-
-
-
-
Field Detail
-
target
protected final Target target
The target method
-
-
Constructor Detail
-
InsnListEx
public InsnListEx(Target target)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getTargetName
public java.lang.String getTargetName()
Description copied from interface:IInsnListExGet the name of the target method- Specified by:
getTargetNamein interfaceIInsnListEx
-
getTargetDesc
public java.lang.String getTargetDesc()
Description copied from interface:IInsnListExGet the descriptor of the target method- Specified by:
getTargetDescin interfaceIInsnListEx
-
getTargetSignature
public java.lang.String getTargetSignature()
Description copied from interface:IInsnListExGet the signature of the target method- Specified by:
getTargetSignaturein interfaceIInsnListEx
-
getTargetAccess
public int getTargetAccess()
Description copied from interface:IInsnListExGet the access flags from the target method- Specified by:
getTargetAccessin interfaceIInsnListEx
-
isTargetStatic
public boolean isTargetStatic()
Description copied from interface:IInsnListExGet whether the target method is static- Specified by:
isTargetStaticin interfaceIInsnListEx
-
isTargetConstructor
public boolean isTargetConstructor()
Description copied from interface:IInsnListExGet whether the target method is a constructor- Specified by:
isTargetConstructorin interfaceIInsnListEx
-
isTargetStaticInitialiser
public boolean isTargetStaticInitialiser()
Description copied from interface:IInsnListExGet whether the target method is a static initialiser- Specified by:
isTargetStaticInitialiserin interfaceIInsnListEx
-
getSpecialNode
public org.objectweb.asm.tree.AbstractInsnNode getSpecialNode(IInsnListEx.SpecialNodeType type)
Description copied from interface:IInsnListExGet - if available - the specified special node from the target. The returned node is not guaranteed to be non-null.- Specified by:
getSpecialNodein interfaceIInsnListEx- Parameters:
type- type of special node to fetch- Returns:
- the special node or null if not available
-
decorate
public <V> InsnListEx decorate(java.lang.String key, V value)
Decorate this insn list with arbitrary metadata for use by context-specific injection points- Type Parameters:
V- value type- Parameters:
key- meta keyvalue- meta value- Returns:
- fluent
-
undecorate
public InsnListEx undecorate(java.lang.String key)
Strip a specific decoration from this list if the decoration exists- Parameters:
key- meta key- Returns:
- fluent
-
undecorate
public InsnListEx undecorate()
Strip all decorations from this list- Returns:
- fluent
-
hasDecoration
public boolean hasDecoration(java.lang.String key)
Get whether this list is decorated with the specified key- Specified by:
hasDecorationin interfaceIInsnListEx- Parameters:
key- meta key- Returns:
- true if the specified decoration exists
-
getDecoration
public <V> V getDecoration(java.lang.String key)
Get the specified decoration- Specified by:
getDecorationin interfaceIInsnListEx- Type Parameters:
V- value type- Parameters:
key- meta key- Returns:
- decoration value or null if absent
-
getDecoration
public <V> V getDecoration(java.lang.String key, V defaultValue)Get the specified decoration or default value- Specified by:
getDecorationin interfaceIInsnListEx- Type Parameters:
V- value type- Parameters:
key- meta keydefaultValue- default value to return- Returns:
- decoration value or null if absent
-
-