Class Utf8Constant

All Implemented Interfaces:
Serializable, Processable

public class Utf8Constant extends Constant
This Constant represents a UTF-8 constant in the constant pool.
See Also:
  • Constructor Details

    • Utf8Constant

      public Utf8Constant()
      Creates an uninitialized Utf8Constant.
    • Utf8Constant

      public Utf8Constant(String string)
      Creates a Utf8Constant containing the given string.
  • Method Details

    • setBytes

      public void setBytes(byte[] bytes)
      Initializes the UTF-8 data with an array of bytes.
    • getBytes

      public byte[] getBytes()
      Returns the UTF-8 data as an array of bytes.
    • setString

      public void setString(String utf8String)
      Initializes the UTF-8 data with a String.
    • getString

      public String getString()
      Returns the UTF-8 data as a String.
    • getTag

      public int getTag()
      Description copied from class: Constant
      Returns the constant pool info tag that specifies the entry type.
      Specified by:
      getTag in class Constant
    • isCategory2

      public boolean isCategory2()
      Description copied from class: Constant
      Returns whether the constant is of category 2. This means that it takes up the space of two category 1 types in the constant pool or on the stack, for instance.
      Specified by:
      isCategory2 in class Constant
    • accept

      public void accept(Clazz clazz, ConstantVisitor constantVisitor)
      Description copied from class: Constant
      Accepts the given visitor.
      Specified by:
      accept in class Constant
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object