jef.dna.attributes
Interface ExceptionTableEntry

All Superinterfaces:
BytesCountable, java.lang.Cloneable
All Known Implementing Classes:
ExceptionTableEntry

public interface ExceptionTableEntry
extends java.lang.Cloneable, BytesCountable

Class representing an ExceptionTable generic entry. These entries describe the exception handlers behaviour in the code array of a Code attribute. An entry is made up of four elements: start_pc, end_pc, handler_pc, catch_type. These entries are stored within a Code attribute ExceptionTable.

Author:
Francesco Russo.

Method Summary
 java.lang.Object clone()
           
 void fromStream(java.io.DataInputStream dis)
          Reads the entry from the given inputstream.
 CodeAttribute getAttributeContainer()
          Get the reference to the CodeAttribute this ExceptionTableEntry is held by.
 int getCatchType()
          If the value of type is non zero, it must refer to an entry of the constant pool table of type ConstantClass (ConstantClassInfo).
 int getEndPc()
          Gets the index at which the exception handler becomes inactive.
 int getHandlerPc()
          Gets the start of the exception handler.
 int getStartPc()
          Gets the index at which the exception handler begins being active.
 void setAttributeContainer(CodeAttribute attribute)
          Set the reference to the CodeAttribute this ExceptionTableEntry is held by.
 void setCatchType(int type)
          If the value of type is non zero, it must refer to an entry of the constant pool table of type ConstantClass (ConstantClassInfo).
 void setEndPc(int end)
          Sets the index at which the exception handler becomes inactive.
 void setHandlerPc(int handler)
          Sets the start of the exception handler.
 void setStartPc(int start)
          Sets the index at which the exception handler begins being active.
 void toStream(java.io.DataOutputStream dos)
          Writes this entry to the given output stream.
 void updateRefs(int offset)
          Updates all the reference to the constant pool table
 boolean validate()
          This method has to perform a validation process over the ExceptionTableEntry according to what specified by the JVM Official Specification.
 
Methods inherited from interface jef.dna.util.BytesCountable
getBytesCount
 

Method Detail

setAttributeContainer

void setAttributeContainer(CodeAttribute attribute)
Set the reference to the CodeAttribute this ExceptionTableEntry is held by.

Parameters:
attribute - The CodeAttribute container

getAttributeContainer

CodeAttribute getAttributeContainer()
Get the reference to the CodeAttribute this ExceptionTableEntry is held by.

Returns:
CodeAttribute The CodeAttribute container

setStartPc

void setStartPc(int start)
Sets the index at which the exception handler begins being active. This value has to be a valid index into the code array of Code attribute instance.

Parameters:
start - The index at which the exc. handler becomes active

getStartPc

int getStartPc()
Gets the index at which the exception handler begins being active. This value has to be a valid index into the code array of Code attribute instance.

Returns:
int The index at which the exc. handler becomes active

setEndPc

void setEndPc(int end)
Sets the index at which the exception handler becomes inactive. This value has to be a valid index into the code array of Code attribute instance.

Parameters:
end - The index at which the exc. handler gets deactivated

getEndPc

int getEndPc()
Gets the index at which the exception handler becomes inactive. This value has to be a valid index into the code array of Code attribute instance.

Returns:
int The index at which the exc. handler gets deactivated

setHandlerPc

void setHandlerPc(int handler)
Sets the start of the exception handler. This value has to be a valid index into the code array of Code attribute instance.

Parameters:
handler - The start of the exception handler

getHandlerPc

int getHandlerPc()
Gets the start of the exception handler. This value has to be a valid index into the code array of Code attribute instance.

Returns:
int The start of the exception handler

setCatchType

void setCatchType(int type)
If the value of type is non zero, it must refer to an entry of the constant pool table of type ConstantClass (ConstantClassInfo).

Parameters:
type - Valid index into the constant pool table

getCatchType

int getCatchType()
If the value of type is non zero, it must refer to an entry of the constant pool table of type ConstantClass (ConstantClassInfo).

Returns:
int Valid index into the constant pool table

toStream

void toStream(java.io.DataOutputStream dos)
              throws java.io.IOException
Writes this entry to the given output stream.

Parameters:
dos - Output stream to write the entry to
Throws:
java.io.IOException - Thrown should something go wrong with the provided output stream

fromStream

void fromStream(java.io.DataInputStream dis)
                throws java.io.IOException
Reads the entry from the given inputstream.

Parameters:
dis - Input stream to read the entry from
Throws:
java.io.IOException - Thrown should something go wrong with the provided input stream

updateRefs

void updateRefs(int offset)
Updates all the reference to the constant pool table

Parameters:
offset - The offset to be applied

validate

boolean validate()
                 throws ExceptionTableEntryValidationException,
                        MissingDnaContainerException,
                        MissingAttributeContainerException,
                        MissingCPTableException
This method has to perform a validation process over the ExceptionTableEntry according to what specified by the JVM Official Specification.

Returns:
boolean The validation outcome
Throws:
ExceptionTableEntryValidationException - The validation failed
MissingDnaContainerException - Is missing the reference to the Dna instance this ExceptionTableEntry belongs to
MissingCPTableException - Cannot access the constant pool table
MissingAttributeContainerException - Is missing the reference to the Attribute this ExceptionTableEntry belongs to

clone

java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException