TNode - node typepublic abstract class ElementNode<TNode>
extends java.lang.Object
target
selectors (FieldNode, MethodNode, FieldInsnNode,
MethodInsnNode and InvokeDynamicInsnNode) which allows access
to common properties of things which are basically "arbitrary node with
owner, name and descriptor"| Modifier and Type | Class and Description |
|---|---|
static class |
ElementNode.NodeType
Element node type, returned by getType so consumers don't need
to do instanceof checks, and allows switching on element type in a more
expressive way
|
| Constructor and Description |
|---|
ElementNode() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Iterable<ElementNode<org.objectweb.asm.tree.AbstractInsnNode>> |
dynamicInsnList(org.objectweb.asm.tree.InsnList insns)
Get a wrapped version of the supplied insn list which returns element
nodes for every INVOKEDYNAMIC instruction only
|
static java.util.List<ElementNode<org.objectweb.asm.tree.FieldNode>> |
fieldList(org.objectweb.asm.tree.ClassNode owner)
Get a list of wrapped ElementNodes for the fields of the supplied owner
class
|
abstract TNode |
get()
Returns the node with horrible duck typing
|
java.lang.String |
getDelegateDesc()
For INVOKEDYNAMIC elements, returns original descriptor of the delegate.
|
abstract java.lang.String |
getDesc()
Get the element descriptor.
|
org.objectweb.asm.tree.FieldNode |
getField()
Get the
FieldNode if this member is a field, otherwise returns
null |
java.lang.String |
getImplDesc()
For INVOKEDYNAMIC elements, returns specialised descriptor of the
delegate (lambda descriptor without prepended captures), can be the same
as the delegate descriptor or more specialised.
|
org.objectweb.asm.tree.AbstractInsnNode |
getInsn()
Get the
instruction if this member is an insn,
otherwise returns null |
org.objectweb.asm.tree.MethodNode |
getMethod()
Get the
MethodNode if this member is a method, otherwise returns
null |
abstract java.lang.String |
getName()
Get the element name
|
abstract java.lang.String |
getOwner()
Get the element owner's name, if this element has an owner, otherwise
returns null
|
abstract java.lang.String |
getSignature()
Get the element signature, can be null
|
java.lang.String |
getSyntheticName()
Get the synthetic element name.
|
abstract ElementNode.NodeType |
getType()
Get the type of this ElementNode, the return value can be used to
determine which accessor (
getMethod(), getField() |
static java.lang.Iterable<ElementNode<org.objectweb.asm.tree.AbstractInsnNode>> |
insnList(org.objectweb.asm.tree.InsnList insns)
Get a wrapped version of the supplied insn list which returns element
nodes for each (supported) instruction (FieldInsnNode, MethodInsnNode and
InvokeDynamicInsnNode).
|
boolean |
isField()
Get whether this element is a field type and the descriptor is a bare
type descriptor without arguments.
|
static <TNode> java.util.List<ElementNode<TNode>> |
listOf(org.objectweb.asm.tree.ClassNode owner,
java.util.List<TNode> list)
Convert the supplied list of nodes to a list of wrapped ElementNodes
|
static java.util.List<ElementNode<org.objectweb.asm.tree.MethodNode>> |
methodList(org.objectweb.asm.tree.ClassNode owner)
Get a list of wrapped ElementNodes for the methods of the supplied owner
class
|
static ElementNode<org.objectweb.asm.tree.FieldNode> |
of(org.objectweb.asm.tree.ClassNode owner,
org.objectweb.asm.tree.FieldNode field)
Create an ElementNode wrapper for the supplied field node
|
static ElementNode<org.objectweb.asm.tree.MethodNode> |
of(org.objectweb.asm.tree.ClassNode owner,
org.objectweb.asm.tree.MethodNode method)
Create an ElementNode wrapper for the supplied method node
|
static <TNode> ElementNode<TNode> |
of(org.objectweb.asm.tree.ClassNode owner,
TNode node)
Create an ElementNode wrapper for the supplied node object
|
static <TNode extends org.objectweb.asm.tree.AbstractInsnNode> |
of(TNode node)
Create an ElementNode wrapper for the supplied node object
|
java.lang.String |
toString() |
public boolean isField()
public abstract ElementNode.NodeType getType()
getMethod(), getField()public org.objectweb.asm.tree.MethodNode getMethod()
MethodNode if this member is a method, otherwise returns
nullpublic org.objectweb.asm.tree.FieldNode getField()
FieldNode if this member is a field, otherwise returns
nullpublic org.objectweb.asm.tree.AbstractInsnNode getInsn()
instruction if this member is an insn,
otherwise returns nullpublic abstract java.lang.String getOwner()
public abstract java.lang.String getName()
public java.lang.String getSyntheticName()
public abstract java.lang.String getDesc()
public java.lang.String getDelegateDesc()
public java.lang.String getImplDesc()
public abstract java.lang.String getSignature()
public abstract TNode get()
public java.lang.String toString()
toString in class java.lang.Objectpublic static ElementNode<org.objectweb.asm.tree.MethodNode> of(org.objectweb.asm.tree.ClassNode owner, org.objectweb.asm.tree.MethodNode method)
owner - class which owns the method or nullmethod - Method node to wrappublic static ElementNode<org.objectweb.asm.tree.FieldNode> of(org.objectweb.asm.tree.ClassNode owner, org.objectweb.asm.tree.FieldNode field)
owner - class which owns the field or nullfield - Field node to wrappublic static <TNode> ElementNode<TNode> of(org.objectweb.asm.tree.ClassNode owner, TNode node)
TNode - Node typeowner - class which owns the node or nullnode - Node to wrapjava.lang.IllegalArgumentException - if the supplied argument is not a
MethodNode or FieldNodepublic static <TNode extends org.objectweb.asm.tree.AbstractInsnNode> ElementNode<TNode> of(TNode node)
TNode - Node typenode - Node to wrapjava.lang.IllegalArgumentException - if the supplied argument is not a
MethodNode or FieldNodepublic static <TNode> java.util.List<ElementNode<TNode>> listOf(org.objectweb.asm.tree.ClassNode owner, java.util.List<TNode> list)
TNode - Node typeowner - Owner of the supplied nodes, can be nulllist - List of nodespublic static java.util.List<ElementNode<org.objectweb.asm.tree.FieldNode>> fieldList(org.objectweb.asm.tree.ClassNode owner)
owner - Class to get fields, must not be nullpublic static java.util.List<ElementNode<org.objectweb.asm.tree.MethodNode>> methodList(org.objectweb.asm.tree.ClassNode owner)
owner - Class to get methods, must not be nullpublic static java.lang.Iterable<ElementNode<org.objectweb.asm.tree.AbstractInsnNode>> insnList(org.objectweb.asm.tree.InsnList insns)
insns - Insn list to wrappublic static java.lang.Iterable<ElementNode<org.objectweb.asm.tree.AbstractInsnNode>> dynamicInsnList(org.objectweb.asm.tree.InsnList insns)
insns - Insn list to wrap