jef.dna.constantInfo.impl
Class ConstantField

java.lang.Object
  extended by jef.dna.constantInfo.impl.ConstantAncestor
      extended by jef.dna.constantInfo.impl.ConstantField
All Implemented Interfaces:
java.lang.Cloneable, ConstantInfo, ConstField
Direct Known Subclasses:
ConstantInterfaceMethod, ConstantMethod

public class ConstantField
extends ConstantAncestor
implements ConstField


Field Summary
protected  int classIndex
           
protected static java.lang.String className
           
protected static Logger logger
           
protected  int nameAndTypeIndex
           
protected  java.lang.String type
           
 
Fields inherited from class jef.dna.constantInfo.impl.ConstantAncestor
cpt, tag
 
Constructor Summary
ConstantField()
           
 
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 getClassIndex()
          The value of the class_index item must be a valid index into the constant_pool table.
 int getNameAndTypeIndex()
          The value of the name_and_type_index item must be a valid index into the constant_pool table.
protected  void innerValidations(ConstantPoolTable cpt)
           
 void setClassIndex(int index)
          The value of the class_index item must be a valid index into the constant_pool table.
 void setNameAndTypeIndex(int index)
          The value of the name_and_type_index item must be a valid index into the constant_pool table.
 void toStream(java.io.DataOutputStream dos)
          This method does not perform anything.
 void updateRefs(int offset)
          This method does not perform anything.
protected  void validateClassIndex(ConstantPoolTable cpt)
           
protected  void validateNameAndTypeIndex(ConstantPoolTable cpt)
           
 
Methods inherited from class jef.dna.constantInfo.impl.ConstantAncestor
getCpt, getTag, getType, setCpt, setTag, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jef.dna.constantInfo.ConstantInfo
getCpt, getTag, getType, setCpt, setTag, validate
 

Field Detail

classIndex

@RefersToCpInfo
protected int classIndex

nameAndTypeIndex

@RefersToCpInfo
protected int nameAndTypeIndex

type

protected java.lang.String type

className

protected static java.lang.String className

logger

protected static Logger logger
Constructor Detail

ConstantField

public ConstantField()
Method Detail

getClassIndex

public int getClassIndex()
Description copied from interface: ConstField
The value of the class_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Class_info structure representing the class or interface type that contains the declaration of the field.

Specified by:
getClassIndex in interface ConstField
Returns:
int The CONSTANT_Class_info index into the constant pool table

setClassIndex

public void setClassIndex(int index)
Description copied from interface: ConstField
The value of the class_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Class_info structure representing the class or interface type that contains the declaration of the field.

Specified by:
setClassIndex in interface ConstField
Parameters:
index - The CONSTANT_Class_info index into the constant pool table

getNameAndTypeIndex

public int getNameAndTypeIndex()
Description copied from interface: ConstField
The value of the name_and_type_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_NameAndType_info. structure. This constant_pool entry indicates the name and descriptor of the field itself.

Specified by:
getNameAndTypeIndex in interface ConstField
Returns:
int The CONSTANT_NameAndType_info index into the constant pool table

setNameAndTypeIndex

public void setNameAndTypeIndex(int index)
Description copied from interface: ConstField
The value of the name_and_type_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_NameAndType_info. structure. This constant_pool entry indicates the name and descriptor of the field itself.

Specified by:
setNameAndTypeIndex in interface ConstField
Parameters:
index - The CONSTANT_NameAndType_info index into the constant pool table

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

updateRefs

public void updateRefs(int offset)
Description copied from class: ConstantAncestor
This method does not perform anything. Implementation subclasses have to provide their own implementation.

Specified by:
updateRefs in interface ConstantInfo
Overrides:
updateRefs in class ConstantAncestor
Parameters:
offset - The offset to be applied

innerValidations

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

validateClassIndex

protected void validateClassIndex(ConstantPoolTable cpt)
                           throws ConstantInfoValidationException,
                                  ConstantInfoAttributeOutOfRangeException
Throws:
ConstantInfoValidationException
ConstantInfoAttributeOutOfRangeException

validateNameAndTypeIndex

protected void validateNameAndTypeIndex(ConstantPoolTable cpt)
                                 throws ConstantInfoValidationException,
                                        ConstantInfoAttributeOutOfRangeException
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