Package org.objectweb.asm
Class Handle
java.lang.Object
org.objectweb.asm.Handle
A reference to a field or a method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
The descriptor of the field or method designated by this handle.private final boolean
Whether the owner is an interface or not.private final String
The name of the field or method designated by this handle.private final String
The internal name of the class that owns the field or method designated by this handle.private final int
The kind of field or method designated by this Handle. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getDesc()
Returns the descriptor of the field or method designated by this handle.getName()
Returns the name of the field or method designated by this handle.getOwner()
Returns the internal name of the class that owns the field or method designated by this handle.int
getTag()
Returns the kind of field or method designated by this handle.int
hashCode()
boolean
Returns true if the owner of the field or method designated by this handle is an interface.toString()
Returns the textual representation of this handle.
-
Field Details
-
tag
private final int tagThe kind of field or method designated by this Handle. Should beOpcodes.H_GETFIELD
,Opcodes.H_GETSTATIC
,Opcodes.H_PUTFIELD
,Opcodes.H_PUTSTATIC
,Opcodes.H_INVOKEVIRTUAL
,Opcodes.H_INVOKESTATIC
,Opcodes.H_INVOKESPECIAL
,Opcodes.H_NEWINVOKESPECIAL
orOpcodes.H_INVOKEINTERFACE
. -
owner
The internal name of the class that owns the field or method designated by this handle. -
name
The name of the field or method designated by this handle. -
descriptor
The descriptor of the field or method designated by this handle. -
isInterface
private final boolean isInterfaceWhether the owner is an interface or not.
-
-
Constructor Details
-
Handle
Deprecated.this constructor has been superseded byHandle(int, String, String, String, boolean)
.Constructs a new field or method handle.- Parameters:
tag
- the kind of field or method designated by this Handle. Must beOpcodes.H_GETFIELD
,Opcodes.H_GETSTATIC
,Opcodes.H_PUTFIELD
,Opcodes.H_PUTSTATIC
,Opcodes.H_INVOKEVIRTUAL
,Opcodes.H_INVOKESTATIC
,Opcodes.H_INVOKESPECIAL
,Opcodes.H_NEWINVOKESPECIAL
orOpcodes.H_INVOKEINTERFACE
.owner
- the internal name of the class that owns the field or method designated by this handle.name
- the name of the field or method designated by this handle.descriptor
- the descriptor of the field or method designated by this handle.
-
Handle
Constructs a new field or method handle.- Parameters:
tag
- the kind of field or method designated by this Handle. Must beOpcodes.H_GETFIELD
,Opcodes.H_GETSTATIC
,Opcodes.H_PUTFIELD
,Opcodes.H_PUTSTATIC
,Opcodes.H_INVOKEVIRTUAL
,Opcodes.H_INVOKESTATIC
,Opcodes.H_INVOKESPECIAL
,Opcodes.H_NEWINVOKESPECIAL
orOpcodes.H_INVOKEINTERFACE
.owner
- the internal name of the class that owns the field or method designated by this handle.name
- the name of the field or method designated by this handle.descriptor
- the descriptor of the field or method designated by this handle.isInterface
- whether the owner is an interface or not.
-
-
Method Details
-
getTag
public int getTag()Returns the kind of field or method designated by this handle. -
getOwner
Returns the internal name of the class that owns the field or method designated by this handle.- Returns:
- the internal name of the class that owns the field or method designated by this handle.
-
getName
Returns the name of the field or method designated by this handle.- Returns:
- the name of the field or method designated by this handle.
-
getDesc
Returns the descriptor of the field or method designated by this handle.- Returns:
- the descriptor of the field or method designated by this handle.
-
isInterface
public boolean isInterface()Returns true if the owner of the field or method designated by this handle is an interface.- Returns:
- true if the owner of the field or method designated by this handle is an interface.
-
equals
-
hashCode
public int hashCode() -
toString
Returns the textual representation of this handle. The textual representation is:- for a reference to a class: owner "." name descriptor " (" tag ")",
- for a reference to an interface: owner "." name descriptor " (" tag " itf)".
-
Handle(int, String, String, String, boolean)
.