at.dms.classfile
Class HandlerInfo

java.lang.Object
  |
  +--at.dms.classfile.HandlerInfo
All Implemented Interfaces:
AccessorContainer

public class HandlerInfo
extends java.lang.Object
implements AccessorContainer

This class represents a protected ("try") portion of block with an handler (catch) for a specified type of exception.


Constructor Summary
HandlerInfo(java.io.DataInput in, ConstantPool cp, Instruction[] insns)
          Constructs a new exception handler info entry from a class file.
HandlerInfo(InstructionAccessor start, InstructionAccessor end, InstructionAccessor handler, java.lang.String thrown)
          Constructs a new exception handler info entry.
 
Method Summary
 InstructionAccessor getEnd()
          Returns the end of the protected area.
 InstructionAccessor getHandler()
          Returns the handler of the protected area.
 InstructionAccessor getStart()
          Returns the start of the protected area.
 java.lang.String getThrown()
          Returns the thrown of the protected area.
(package private)  void resolveConstants(ConstantPool cp)
          Insert or check location of constant value on constant pool.
 void setEnd(InstructionAccessor end)
          Sets the end of the protected area.
 void setHandler(InstructionAccessor handler)
          Sets the handler of the protected area.
 void setStart(InstructionAccessor start)
          Sets the start of the protected area.
 void transformAccessors(AccessorTransformer transformer)
          Transforms targets (deferences to actual instructions).
(package private)  void write(ConstantPool cp, java.io.DataOutput out)
          Write this class into the the file (out) getting data position from the constant pool.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandlerInfo

public HandlerInfo(InstructionAccessor start,
                   InstructionAccessor end,
                   InstructionAccessor handler,
                   java.lang.String thrown)
Constructs a new exception handler info entry.
Parameters:
start - the beginning of the checked area (inclusive).
end - the end of the checked area (inclusive !).
handler - the entrypoint into the exception handling routine.
thrown - the exceptions handled by this routine.

HandlerInfo

public HandlerInfo(java.io.DataInput in,
                   ConstantPool cp,
                   Instruction[] insns)
            throws java.io.IOException
Constructs a new exception handler info entry from a class file.
Parameters:
in - the stream to read from
cp - the constant pool
insns - (sparse) array of instructions
Throws:
java.io.IOException - an io problem has occured.
Method Detail

transformAccessors

public void transformAccessors(AccessorTransformer transformer)
                        throws BadAccessorException
Transforms targets (deferences to actual instructions).
Specified by:
transformAccessors in interface AccessorContainer
Following copied from interface: at.dms.classfile.AccessorContainer
Parameters:
transformer - The transformer used to transform accessors.

setStart

public void setStart(InstructionAccessor start)
Sets the start of the protected area.

getStart

public InstructionAccessor getStart()
Returns the start of the protected area.

setEnd

public void setEnd(InstructionAccessor end)
Sets the end of the protected area.

getEnd

public InstructionAccessor getEnd()
Returns the end of the protected area.

setHandler

public void setHandler(InstructionAccessor handler)
Sets the handler of the protected area.

getHandler

public InstructionAccessor getHandler()
Returns the handler of the protected area.

getThrown

public java.lang.String getThrown()
Returns the thrown of the protected area.

resolveConstants

void resolveConstants(ConstantPool cp)
Insert or check location of constant value on constant pool.
Parameters:
cp - the constant pool for this class.

write

void write(ConstantPool cp,
           java.io.DataOutput out)
     throws java.io.IOException
Write this class into the the file (out) getting data position from the constant pool.
Parameters:
cp - the constant pool that contain all data.
out - the file where to write this object info.
Throws:
java.io.IOException - an io problem has occured.