Class StackMapType

java.lang.Object
org.apache.bcel.classfile.StackMapType
All Implemented Interfaces:
Cloneable, Node

public final class StackMapType extends Object implements Node, Cloneable
This class represents the type of a local variable or item on stack used in the StackMap entries.
See Also:
  • Field Details

  • Constructor Details

    • StackMapType

      public StackMapType(byte type, int index, ConstantPool constantPool)
      Parameters:
      type - type tag as defined in the Constants interface
      index - index to constant pool, or byte code offset
  • Method Details

    • 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.
      Specified by:
      accept in interface Node
      Parameters:
      v - Visitor object
      Since:
      6.8.0
    • copy

      public StackMapType copy()
      Returns:
      deep copy of this object
    • dump

      public void dump(DataOutputStream file) throws IOException
      Dump type entries to file.
      Parameters:
      file - Output file stream
      Throws:
      IOException - if an I/O error occurs.
    • getClassName

      public 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

      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
    • 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 String toString()
      Overrides:
      toString in class Object
      Returns:
      String representation