fr.umlv.corosol.classfile.constant.impl
Class DefaultJConstantUtf8

java.lang.Object
  extended by fr.umlv.corosol.classfile.constant.impl.AbstractJConstant
      extended by fr.umlv.corosol.classfile.constant.impl.DefaultJConstantUtf8
All Implemented Interfaces:
JConstant, JConstantUtf8, JClassFileItem, JObject

public class DefaultJConstantUtf8
extends AbstractJConstant
implements JConstantUtf8

The default implementation of JConstantUtf8 interface.

Author:
Christophe Deleray

Field Summary
 
Fields inherited from interface fr.umlv.corosol.classfile.constant.JConstant
CONSTANT_CLASS, CONSTANT_DOUBLE, CONSTANT_FIELDREF, CONSTANT_FLOAT, CONSTANT_INTEGER, CONSTANT_INTERFACE_METHODREF, CONSTANT_LONG, CONSTANT_METHODREF, CONSTANT_NAME_AND_TYPE, CONSTANT_STRING, CONSTANT_UTF8
 
Constructor Summary
DefaultJConstantUtf8()
          Default constructor.
DefaultJConstantUtf8(java.lang.String string)
          Creates a new Constant_UTF8_info entry.
 
Method Summary
 java.lang.String getString()
          Returns the String object representing the Utf8 character sequence of this entry.
 void readItem(JClassFileInput in)
          Extracts the data of this constant pool entry from the specified input stream.
 void setString(java.lang.String string)
          Sets this entry with the Utf8 character sequence of the specified String object.
 java.lang.String toString()
          Returns a string representation of this constant pool entry.
 void writeItem(JClassFileOutput out)
          Writes the data of this constant pool entry to a classfile via the specified output stream.
 
Methods inherited from class fr.umlv.corosol.classfile.constant.impl.AbstractJConstant
getConstantPool, getLength, getTag, setConstantPool
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fr.umlv.corosol.classfile.constant.JConstant
getLength, getTag
 
Methods inherited from interface fr.umlv.corosol.classfile.JClassFileItem
getConstantPool, setConstantPool
 

Constructor Detail

DefaultJConstantUtf8

public DefaultJConstantUtf8()
Default constructor.


DefaultJConstantUtf8

public DefaultJConstantUtf8(java.lang.String string)
Creates a new Constant_UTF8_info entry.

Parameters:
string - a UTF string
Method Detail

getString

public java.lang.String getString()
Returns the String object representing the Utf8 character sequence of this entry.

Specified by:
getString in interface JConstantUtf8
Returns:
an Utf8 String object designed by this entry

setString

public void setString(java.lang.String string)
Sets this entry with the Utf8 character sequence of the specified String object.

Specified by:
setString in interface JConstantUtf8
Parameters:
string - an Utf8 String object

readItem

public void readItem(JClassFileInput in)
              throws java.io.IOException
Extracts the data of this constant pool entry from the specified input stream.

Specified by:
readItem in interface JClassFileItem
Parameters:
in - a class file input stream
Throws:
java.io.IOException - if an I/O error occurs when reading the datas of this constant pool entry

writeItem

public void writeItem(JClassFileOutput out)
               throws java.io.IOException
Writes the data of this constant pool entry to a classfile via the specified output stream.

Specified by:
writeItem in interface JClassFileItem
Parameters:
out - a class file output stream
Throws:
java.io.IOException - if an I/O error occurs when writing into the classfile

toString

public java.lang.String toString()
Returns a string representation of this constant pool entry.

Specified by:
toString in interface JConstant
Specified by:
toString in class AbstractJConstant
Returns:
a string representing this constant pool entry