jef.dna.attributes.impl
Class InnerClassesTableEntry

java.lang.Object
  extended by jef.dna.attributes.impl.InnerClassesTableEntry
All Implemented Interfaces:
java.lang.Cloneable, InnerClassesTableEntry, BytesCountable

public class InnerClassesTableEntry
extends java.lang.Object
implements InnerClassesTableEntry

Class representing an Inner Classes instance's table entry.

Author:
Francesco Russo frusso@cs.unibo.it

Field Summary
protected static Logger logger
           
 
Constructor Summary
InnerClassesTableEntry()
          Creates a new instance of InnerClassesTableEntry
 
Method Summary
 java.lang.Object clone()
          The clone() method will return a new instance whose reference to the containing InnerClassesAttribute is not modified.
 void fromStream(java.io.DataInputStream dis)
          Populates the current InnerClassesTableEntry instance with the given DataInputStream.
 InnerClassesAttribute getAttributeContainer()
          Get the attribute containing the InnerClassesTableEntry
 int getBytesCount()
          This method must return the overall number of bytes required by the component implementing this interface.
 int getInnerClassAccessFlags()
          Returns the access flags set via the setInnerClassAccessFlags method.
 int getInnerClassInfoIndex()
          The value of the inner_class_info_index item must be zero or a valid index into the constant_pool table.
 int getInnerNameIndex()
          If the inner class is anonymous, the value of the inner_name_index item must be zero.
 int getOuterClassInfoIndex()
          If the inner class is not a member, the value of the outer_class_info_index item must be zero.
 void setAttributeContainer(InnerClassesAttribute attr)
          Set the attribute containing the InnerClassesTableEntry
 void setInnerClassAccesFlags(int accessFlags)
          The value of the inner_class_access_flags item is a mask of flags used to denote access permissions to and properties of class or interface as declared in the source code from which this class file was compiled.
 void setInnerClassInfoIndex(int innClassInfoIndex)
          The value of the inner_class_info_index item must be zero or a valid index into the constant_pool table.
 void setInnerNameIndex(int innNameIndex)
          If the inner class is anonymous, the value of the inner_name_index item must be zero.
 void setOuterClassInfoIndex(int outClassInfoIndex)
          If the inner class is not a member, the value of the outer_class_info_index item must be zero.
 void toStream(java.io.DataOutputStream dos)
          Serializes the current InnerClassesTableEntry to the given DataOutputStream.
 void updateRefs(int offset)
          Updates all the references to constant pool table entries by the given offset.
 void validate()
          Perform validation over the InnerClassesTableEntry
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static Logger logger
Constructor Detail

InnerClassesTableEntry

public InnerClassesTableEntry()
Creates a new instance of InnerClassesTableEntry

Method Detail

setInnerClassInfoIndex

public void setInnerClassInfoIndex(int innClassInfoIndex)
Description copied from interface: InnerClassesTableEntry
The value of the inner_class_info_index item must be zero or a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Class_info structure representing the inner class. The remaining items in the classes array entry give information about the inner class itself.

Specified by:
setInnerClassInfoIndex in interface InnerClassesTableEntry
Parameters:
innClassInfoIndex - A valid index into the constant pool table

getInnerClassInfoIndex

public int getInnerClassInfoIndex()
Description copied from interface: InnerClassesTableEntry
The value of the inner_class_info_index item must be zero or a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Class_info structure representing the inner class. The remaining items in the classes array entry give information about the inner class itself.

Specified by:
getInnerClassInfoIndex in interface InnerClassesTableEntry
Returns:
int A valid index into the constant pool table

setOuterClassInfoIndex

public void setOuterClassInfoIndex(int outClassInfoIndex)
Description copied from interface: InnerClassesTableEntry
If the inner class is not a member, the value of the outer_class_info_index item must be zero. Otherwise, the value of the outer_class_info_index item must be a valid index into the constant_pool table, and the entry at that index must be a CONSTANT_Class_info structure representing the class or interface of which the inner class is a member

Specified by:
setOuterClassInfoIndex in interface InnerClassesTableEntry
Parameters:
outClassInfoIndex - A valid index into the constant pool table

getOuterClassInfoIndex

public int getOuterClassInfoIndex()
Description copied from interface: InnerClassesTableEntry
If the inner class is not a member, the value of the outer_class_info_index item must be zero. Otherwise, the value of the outer_class_info_index item must be a valid index into the constant_pool table, and the entry at that index must be a CONSTANT_Class_info structure representing the class or interface of which the inner class is a member

Specified by:
getOuterClassInfoIndex in interface InnerClassesTableEntry
Returns:
int A valid index into the constant pool table

setInnerNameIndex

public void setInnerNameIndex(int innNameIndex)
Description copied from interface: InnerClassesTableEntry
If the inner class is anonymous, the value of the inner_name_index item must be zero. Otherwise, the value of the inner_name_index item must be a valid index into the constant_pool table, and the entry at that index must be a CONSTANT_Utf8_info structure that represents the original simple name of the inner class, as given in the source code from which this class file was compiled

Specified by:
setInnerNameIndex in interface InnerClassesTableEntry
Parameters:
innNameIndex - A valid index into the constant pool table

getInnerNameIndex

public int getInnerNameIndex()
Description copied from interface: InnerClassesTableEntry
If the inner class is anonymous, the value of the inner_name_index item must be zero. Otherwise, the value of the inner_name_index item must be a valid index into the constant_pool table, and the entry at that index must be a CONSTANT_Utf8_info structure that represents the original simple name of the inner class, as given in the source code from which this class file was compiled

Specified by:
getInnerNameIndex in interface InnerClassesTableEntry
Returns:
int A valid index into the constant pool table

setInnerClassAccesFlags

public void setInnerClassAccesFlags(int accessFlags)
Description copied from interface: InnerClassesTableEntry
The value of the inner_class_access_flags item is a mask of flags used to denote access permissions to and properties of class or interface as declared in the source code from which this class file was compiled. It is used by compilers to recover the original information when source code is not available. The flags are:
Flag Name Value Meaning
ACC_PUBLIC 0x0001 Marked or implicitly public in source.
ACC_PRIVATE 0x0002 Marked private in source.
ACC_PROTECTED 0x0004 Marked protected in source.
ACC_STATIC 0x0008 Marked or implicitly static in source.
ACC_FINAL 0x0010 Marked final in source.
ACC_INTERFACE 0x0200 Was an interface in source.
ACC_ABSTRACT 0x0400 Marked or implicitly abstract in source.

Specified by:
setInnerClassAccesFlags in interface InnerClassesTableEntry
Parameters:
accessFlags - A bit mask denoting the which access modifiers are applied to the given class

getInnerClassAccessFlags

public int getInnerClassAccessFlags()
Description copied from interface: InnerClassesTableEntry
Returns the access flags set via the setInnerClassAccessFlags method.

Specified by:
getInnerClassAccessFlags in interface InnerClassesTableEntry
Returns:
int The bit mask of the access flags defines by the following table
Flag Name Value Meaning
ACC_PUBLIC 0x0001 Marked or implicitly public in source.
ACC_PRIVATE 0x0002 Marked private in source.
ACC_PROTECTED 0x0004 Marked protected in source.
ACC_STATIC 0x0008 Marked or implicitly static in source.
ACC_FINAL 0x0010 Marked final in source.
ACC_INTERFACE 0x0200 Was an interface in source.
ACC_ABSTRACT 0x0400 Marked or implicitly abstract in source.

setAttributeContainer

public void setAttributeContainer(InnerClassesAttribute attr)
Description copied from interface: InnerClassesTableEntry
Set the attribute containing the InnerClassesTableEntry

Specified by:
setAttributeContainer in interface InnerClassesTableEntry
Parameters:
attr - The instance containing the current InnerClassesTableEntry

getAttributeContainer

public InnerClassesAttribute getAttributeContainer()
Description copied from interface: InnerClassesTableEntry
Get the attribute containing the InnerClassesTableEntry

Specified by:
getAttributeContainer in interface InnerClassesTableEntry
Returns:
InnerClassesTableEntry The instance containing the current InnerClassesTableEntry

toStream

public void toStream(java.io.DataOutputStream dos)
              throws java.io.IOException
Description copied from interface: InnerClassesTableEntry
Serializes the current InnerClassesTableEntry to the given DataOutputStream.

Specified by:
toStream in interface InnerClassesTableEntry
Parameters:
dos - The stream over which the current instance has to be serialized
Throws:
java.io.IOException - Something went wrong with the provided output stream

fromStream

public void fromStream(java.io.DataInputStream dis)
                throws java.io.IOException
Description copied from interface: InnerClassesTableEntry
Populates the current InnerClassesTableEntry instance with the given DataInputStream.

Specified by:
fromStream in interface InnerClassesTableEntry
Parameters:
dis - The stream from which the current instance has to be populated
Throws:
java.io.IOException - Something went wrong with the provided input stream

updateRefs

public void updateRefs(int offset)
Description copied from interface: InnerClassesTableEntry
Updates all the references to constant pool table entries by the given offset.

Specified by:
updateRefs in interface InnerClassesTableEntry
Parameters:
offset - The offset to be used

validate

public void validate()
              throws MissingAttributeContainerException,
                     MissingDnaContainerException,
                     MissingCPTableException,
                     InnerClassesTableEntryValidationException
Description copied from interface: InnerClassesTableEntry
Perform validation over the InnerClassesTableEntry

Specified by:
validate in interface InnerClassesTableEntry
Throws:
MissingAttributeContainerException
MissingDnaContainerException
InnerClassesTableEntryValidationException
MissingCPTableException

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
The clone() method will return a new instance whose reference to the containing InnerClassesAttribute is not modified.

Specified by:
clone in interface InnerClassesTableEntry
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getBytesCount

public int getBytesCount()
Description copied from interface: BytesCountable
This method must return the overall number of bytes required by the component implementing this interface.

Specified by:
getBytesCount in interface BytesCountable