ej-technologies

org.gjt.jclasslib.structures.attributes
Class ExceptionTableEntry

java.lang.Object
  extended byorg.gjt.jclasslib.structures.AbstractStructure
      extended byorg.gjt.jclasslib.structures.attributes.ExceptionTableEntry

public class ExceptionTableEntry
extends AbstractStructure

Describes an exception table entry in a Code attribute structure.

Version:
$Revision: 1.4 $ $Date: 2003/08/18 07:52:05 $
Author:
Ingo Kegel

Field Summary
static int LENGTH
          Length in bytes of an exception table entry.
 
Fields inherited from class org.gjt.jclasslib.structures.AbstractStructure
classFile, debug, SYSTEM_PROPERTY_DEBUG
 
Constructor Summary
ExceptionTableEntry()
          Constructor.
ExceptionTableEntry(int startPc, int endPc, int handlerPc, int catchType)
          Constructor.
 
Method Summary
static ExceptionTableEntry create(DataInput in, ClassFile classFile)
          Factory method for creating ExceptionTableEntry structures.
protected  void debug(String message)
          Utility method for derived structures.
 int getCatchType()
          Get the constant pool index for the catch type of this exception table entry.
 int getEndPc()
          Get the end_pc of this exception table entry.
 int getHandlerPc()
          Get the handler_pc of this exception table entry.
 int getStartPc()
          Get the start_pc of this exception table entry.
 void read(DataInput in)
          Read this structure from the given DataInput.
 void setCatchType(int catchType)
          Set the constant pool index for the catch type of this exception table entry.
 void setEndPc(int endPc)
          Set the end_pc of this exception table entry.
 void setHandlerPc(int handlerPc)
          Set the handler_pc of this exception table entry.
 void setStartPc(int startPc)
          Set the start_pc of this exception table entry.
 void write(DataOutput out)
          Write this structure to the given DataOutput.
 
Methods inherited from class org.gjt.jclasslib.structures.AbstractStructure
getClassFile, getDebug, getLength, printAccessFlags, printAccessFlagsVerbose, printBytes, setClassFile, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LENGTH

public static final int LENGTH
Length in bytes of an exception table entry.

See Also:
Constant Field Values
Constructor Detail

ExceptionTableEntry

public ExceptionTableEntry()
Constructor.


ExceptionTableEntry

public ExceptionTableEntry(int startPc,
                           int endPc,
                           int handlerPc,
                           int catchType)
Constructor.

Parameters:
startPc - the start_pc
endPc - the end_pc
handlerPc - the handler_pc
catchType - the constant pool index for the catch type of this exception table entry
Method Detail

create

public static ExceptionTableEntry create(DataInput in,
                                         ClassFile classFile)
                                  throws InvalidByteCodeException,
                                         IOException
Factory method for creating ExceptionTableEntry structures.

Parameters:
in - the DataInput from which to read the ExceptionTableEntry structure
classFile - the parent class file of the structure to be created
Returns:
the new ExceptionTableEntry structure
Throws:
InvalidByteCodeException - if the byte code is invalid
IOException - if an exception occurs with the DataInput

getStartPc

public int getStartPc()
Get the start_pc of this exception table entry.

Returns:
the start_pc

setStartPc

public void setStartPc(int startPc)
Set the start_pc of this exception table entry.

Parameters:
startPc - the start_pc

getEndPc

public int getEndPc()
Get the end_pc of this exception table entry.

Returns:
the end_pc

setEndPc

public void setEndPc(int endPc)
Set the end_pc of this exception table entry.

Parameters:
endPc - the end_pc

getHandlerPc

public int getHandlerPc()
Get the handler_pc of this exception table entry.

Returns:
the handler_pc

setHandlerPc

public void setHandlerPc(int handlerPc)
Set the handler_pc of this exception table entry.

Parameters:
handlerPc - the handler_pc

getCatchType

public int getCatchType()
Get the constant pool index for the catch type of this exception table entry.

Returns:
the index

setCatchType

public void setCatchType(int catchType)
Set the constant pool index for the catch type of this exception table entry.

Parameters:
catchType - the index

read

public void read(DataInput in)
          throws InvalidByteCodeException,
                 IOException
Description copied from class: AbstractStructure
Read this structure from the given DataInput.

Excpects DataInput to be in JVM class file format and just before a structure of this kind. No look ahead parsing since the class file format is deterministic.

Overrides:
read in class AbstractStructure
Parameters:
in - the DataInput from which to read
Throws:
InvalidByteCodeException - if the byte code is invalid
IOException - if an exception occurs with the DataInput

write

public void write(DataOutput out)
           throws InvalidByteCodeException,
                  IOException
Description copied from class: AbstractStructure
Write this structure to the given DataOutput.

The written bytes are in JVM class file format.

Overrides:
write in class AbstractStructure
Parameters:
out - the DataOutput to which to write
Throws:
InvalidByteCodeException - if the structure is internally inconsistent
IOException - if an exception occurs with the DataOutput

debug

protected void debug(String message)
Description copied from class: AbstractStructure
Utility method for derived structures. Dump a specific debug message.

Overrides:
debug in class AbstractStructure
Parameters:
message - the debug message

ej-technologies