TNode - node typepublic abstract class ElementNode<TNode>
extends java.lang.Object
FieldNode and MethodNode for consumers which can
handle both types (since they have a lot in common), with common accessors
for overlapping properties.| Modifier | Constructor and Description |
|---|---|
protected |
ElementNode(org.objectweb.asm.tree.ClassNode owner) |
| Modifier and Type | Method and Description |
|---|---|
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
|
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 |
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
|
org.objectweb.asm.tree.ClassNode |
getOwner()
Get the element's owner, can be null
|
java.lang.String |
getOwnerName()
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
|
boolean |
isField()
get whether this element is a field
|
boolean |
isMethod()
Get whether this element is a method
|
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
|
public boolean isMethod()
public boolean isField()
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.ClassNode getOwner()
public java.lang.String getOwnerName()
public abstract java.lang.String getName()
public abstract java.lang.String getDesc()
public abstract java.lang.String getSignature()
public abstract TNode get()
public 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> 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 null