Package org.apache.bcel.classfile
Class StackMapType
- java.lang.Object
-
- org.apache.bcel.classfile.StackMapType
-
- All Implemented Interfaces:
java.lang.Cloneable
,Node
public final class StackMapType extends java.lang.Object implements Node, java.lang.Cloneable
This class represents the type of a local variable or item on stack used in the StackMap entries.- See Also:
StackMapEntry
,StackMap
,Const
-
-
Field Summary
Fields Modifier and Type Field Description private ConstantPool
constantPool
static StackMapType[]
EMPTY_ARRAY
private int
index
private byte
type
-
Constructor Summary
Constructors Constructor Description StackMapType(byte type, int index, ConstantPool constantPool)
StackMapType(java.io.DataInput file, ConstantPool constantPool)
Constructs object from file stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.private byte
checkType(byte type)
StackMapType
copy()
void
dump(java.io.DataOutputStream file)
Dump type entries to file.java.lang.String
getClassName()
Gets the class name of this StackMapType from the constant pool at index position.ConstantPool
getConstantPool()
int
getIndex()
byte
getType()
boolean
hasIndex()
private java.lang.String
printIndex()
void
setConstantPool(ConstantPool constantPool)
void
setIndex(int index)
void
setType(byte type)
java.lang.String
toString()
-
-
-
Field Detail
-
EMPTY_ARRAY
public static final StackMapType[] EMPTY_ARRAY
-
type
private byte type
-
index
private int index
-
constantPool
private ConstantPool constantPool
-
-
Constructor Detail
-
StackMapType
public StackMapType(byte type, int index, ConstantPool constantPool)
- Parameters:
type
- type tag as defined in the Constants interfaceindex
- index to constant pool, or byte code offset
-
StackMapType
StackMapType(java.io.DataInput file, ConstantPool constantPool) throws java.io.IOException
Constructs object from file stream.- Parameters:
file
- Input stream- Throws:
java.io.IOException
- if an I/O error occurs.
-
-
Method Detail
-
accept
public void accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
-
checkType
private byte checkType(byte type)
-
copy
public StackMapType copy()
- Returns:
- deep copy of this object
-
dump
public void dump(java.io.DataOutputStream file) throws java.io.IOException
Dump type entries to file.- Parameters:
file
- Output file stream- Throws:
java.io.IOException
- if an I/O error occurs.
-
getClassName
public java.lang.String getClassName()
Gets the class name of this StackMapType from the constant pool at index position.- Returns:
- the fully qualified name of the class for this StackMapType.
- Since:
- 6.8.0
-
getConstantPool
public ConstantPool getConstantPool()
- Returns:
- Constant pool used by this object.
-
getIndex
public int getIndex()
- Returns:
- index to constant pool if type == ITEM_Object, or offset in byte code, if type == ITEM_NewObject, and -1 otherwise
-
getType
public byte getType()
-
hasIndex
public boolean hasIndex()
- Returns:
- true, if type is either ITEM_Object or ITEM_NewObject
-
printIndex
private java.lang.String printIndex()
-
setConstantPool
public void setConstantPool(ConstantPool constantPool)
- Parameters:
constantPool
- Constant pool to be used for this object.
-
setIndex
public void setIndex(int index)
-
setType
public void setType(byte type)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation
-
-