proguard.classfile.constant
Class Utf8Constant

java.lang.Object
  extended by proguard.classfile.constant.Constant
      extended by proguard.classfile.constant.Utf8Constant
All Implemented Interfaces:
VisitorAccepter

public class Utf8Constant
extends Constant

This Constant represents a UTF-8 constant in the constant pool.


Field Summary
 
Fields inherited from class proguard.classfile.constant.Constant
visitorInfo
 
Constructor Summary
Utf8Constant()
          Creates an uninitialized Utf8Constant.
Utf8Constant(java.lang.String string)
          Creates a Utf8Constant containing the given string.
 
Method Summary
 void accept(Clazz clazz, ConstantVisitor constantVisitor)
          Accepts the given visitor.
 byte[] getBytes()
          Returns the UTF-8 data as an array of bytes.
 java.lang.String getString()
          Returns the UTF-8 data as a String.
 int getTag()
          Returns the constant pool info tag that specifies the entry type.
 void setBytes(byte[] bytes)
          Initializes the UTF-8 data with an array of bytes.
 void setString(java.lang.String utf8String)
          Initializes the UTF-8 data with a String.
 
Methods inherited from class proguard.classfile.constant.Constant
getVisitorInfo, setVisitorInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utf8Constant

public Utf8Constant()
Creates an uninitialized Utf8Constant.


Utf8Constant

public Utf8Constant(java.lang.String string)
Creates a Utf8Constant containing the given string.

Method Detail

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(java.lang.String utf8String)
Initializes the UTF-8 data with a String.


getString

public java.lang.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

accept

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

Specified by:
accept in class Constant