Class 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
    • Constructor Summary

      Constructors 
      Constructor Description
      StackMapType​(byte type, int index, ConstantPool constantPool)
      Constructs a StackMapType.
    • 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.
      StackMapType copy()
      Creates a deep copy of this object.
      void dump​(java.io.DataOutputStream file)
      Dumps type entries to file.
      java.lang.String getClassName()
      Gets the class name of this StackMapType from the constant pool at index position.
      ConstantPool getConstantPool()
      Gets the constant pool.
      int getIndex()
      Gets the index.
      byte getType()
      Gets the type.
      boolean hasIndex()
      Checks if this type has an index.
      void setConstantPool​(ConstantPool constantPool)
      Sets the constant pool.
      void setIndex​(int index)
      Sets the index.
      void setType​(byte type)
      Sets the type.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StackMapType

        public StackMapType​(byte type,
                            int index,
                            ConstantPool constantPool)
        Constructs a StackMapType.
        Parameters:
        type - type tag as defined in the Constants interface.
        index - index to constant pool, or byte code offset.
        constantPool - The constant pool.
    • 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.
        Specified by:
        accept in interface Node
        Parameters:
        v - Visitor object.
        Since:
        6.8.0
      • copy

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

        public void dump​(java.io.DataOutputStream file)
                  throws java.io.IOException
        Dumps type entries to file.
        Parameters:
        file - Output file stream.
        Throws:
        java.io.IOException - Thrown 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
      • getIndex

        public int getIndex()
        Gets the index.
        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()
        Gets the type.
        Returns:
        The type.
      • hasIndex

        public boolean hasIndex()
        Checks if this type has an index.
        Returns:
        true, if type is either ITEM_Object or ITEM_NewObject.
      • setConstantPool

        public void setConstantPool​(ConstantPool constantPool)
        Sets the constant pool.
        Parameters:
        constantPool - Constant pool to be used for this object.
      • setIndex

        public void setIndex​(int index)
        Sets the index.
        Parameters:
        index - The index.
      • setType

        public void setType​(byte type)
        Sets the type.
        Parameters:
        type - The type.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation.