jef.dna.constantInfo.impl
Class ConstantUtf8

java.lang.Object
  extended by jef.dna.constantInfo.impl.ConstantAncestor
      extended by jef.dna.constantInfo.impl.ConstantUtf8
All Implemented Interfaces:
java.lang.Cloneable, ConstantInfo, ConstUtf8

@ClosingCpInfo
public class ConstantUtf8
extends ConstantAncestor
implements ConstUtf8


Field Summary
protected static java.lang.String className
           
protected static Logger logger
           
protected  java.lang.String type
           
 
Fields inherited from class jef.dna.constantInfo.impl.ConstantAncestor
cpt, tag
 
Constructor Summary
ConstantUtf8()
           
 
Method Summary
 java.lang.Object clone()
          The clone() method will return a new instance whose reference to the containing ConstantPoolTable instance is set to null.
 void fromStream(java.io.DataInputStream dis)
          This method does not perform anything.
 int getLength()
          The value of the length item gives the number of bytes in the bytes array (not the length of the resulting string).
 byte[] getValue()
          The bytes array contains the bytes of the string.
protected  void innerValidations(ConstantPoolTable cpt)
           
 void setLength(int len)
          The value of the length item gives the number of bytes in the bytes array (not the length of the resulting string).
 void setValue(byte[] val)
          The bytes array contains the bytes of the string.
 void toStream(java.io.DataOutputStream dos)
          This method does not perform anything.
 java.lang.String toString()
           
 
Methods inherited from class jef.dna.constantInfo.impl.ConstantAncestor
getCpt, getTag, getType, setCpt, setTag, updateRefs, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jef.dna.constantInfo.ConstantInfo
getCpt, getTag, getType, setCpt, setTag, updateRefs, validate
 

Field Detail

type

protected java.lang.String type

className

protected static java.lang.String className

logger

protected static Logger logger
Constructor Detail

ConstantUtf8

public ConstantUtf8()
Method Detail

getLength

public int getLength()
Description copied from interface: ConstUtf8
The value of the length item gives the number of bytes in the bytes array (not the length of the resulting string). The strings in the CONSTANT_Utf8_info structure are not null-terminated.

Specified by:
getLength in interface ConstUtf8
Returns:
int The length of the byte array representing the string

setLength

public void setLength(int len)
Description copied from interface: ConstUtf8
The value of the length item gives the number of bytes in the bytes array (not the length of the resulting string). The strings in the CONSTANT_Utf8_info structure are not null-terminated.

Specified by:
setLength in interface ConstUtf8
Parameters:
len - The length of the byte array representing the string

getValue

public byte[] getValue()
Description copied from interface: ConstUtf8
The bytes array contains the bytes of the string. No byte may have the value (byte)0 or lie in the range (byte)0xf0-(byte)0xff.

Specified by:
getValue in interface ConstUtf8
Returns:
byte[] The byte array representing the string

setValue

public void setValue(byte[] val)
Description copied from interface: ConstUtf8
The bytes array contains the bytes of the string. No byte may have the value (byte)0 or lie in the range (byte)0xf0-(byte)0xff.

Specified by:
setValue in interface ConstUtf8
Parameters:
val - The byte array representing the string

toStream

public void toStream(java.io.DataOutputStream dos)
              throws DnaSerializationException
Description copied from class: ConstantAncestor
This method does not perform anything. Implementation subclasses have to provide their own implementation.

Specified by:
toStream in interface ConstantInfo
Specified by:
toStream in class ConstantAncestor
Parameters:
dos - The DataOutputStream to write the object to
Throws:
DnaSerializationException

fromStream

public void fromStream(java.io.DataInputStream dis)
                throws DnaDeserializationException
Description copied from class: ConstantAncestor
This method does not perform anything. Implementation subclasses have to provide their own implementation.

Specified by:
fromStream in interface ConstantInfo
Specified by:
fromStream in class ConstantAncestor
Parameters:
dis - The DataInputStream for reading the Constant Info fields
Throws:
DnaDeserializationException

innerValidations

protected void innerValidations(ConstantPoolTable cpt)
                         throws ConstantInfoValidationException,
                                ConstantInfoAttributeOutOfRangeException
Specified by:
innerValidations in class ConstantAncestor
Throws:
ConstantInfoValidationException
ConstantInfoAttributeOutOfRangeException

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
The clone() method will return a new instance whose reference to the containing ConstantPoolTable instance is set to null. It is up to you appropriately setting it to the correct value.

Specified by:
clone in interface ConstantInfo
Overrides:
clone in class ConstantAncestor
Returns:
The clone
Throws:
java.lang.CloneNotSupportedException

toString

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