soot
Class AbstractTrap

java.lang.Object
  |
  +--soot.AbstractTrap
All Implemented Interfaces:
Trap
Direct Known Subclasses:
BTrap, GTrap, JTrap

public class AbstractTrap
extends java.lang.Object
implements Trap

Partial implementation of trap (exception catcher), used within Body classes.


Field Summary
protected  UnitBox beginUnitBox
          The first unit being trapped.
protected  UnitBox endUnitBox
          The unit just before the last unit being trapped.
protected  SootClass exception
          The exception being caught.
protected  UnitBox handlerUnitBox
          The unit to which execution flows after the caught exception is triggered.
protected  java.util.List unitBoxes
          The list of unitBoxes referred to in this Trap (begin, end and handler.
 
Constructor Summary
protected AbstractTrap(SootClass exception, UnitBox beginUnitBox, UnitBox endUnitBox, UnitBox handlerUnitBox)
          Creates an AbstractTrap with the given exception, handler, begin and end units.
 
Method Summary
 java.lang.Object clone()
          Performs a shallow clone of this trap.
 Unit getBeginUnit()
          Returns the first trapped unit.
 UnitBox getBeginUnitBox()
          Returns the box holding this trap's first trapped unit.
 Unit getEndUnit()
          Returns the last trapped unit.
 UnitBox getEndUnitBox()
          Returns the box holding this trap's last trapped unit.
 SootClass getException()
          Returns the exception being caught.
 Unit getHandlerUnit()
          Returns the unit handling the exception being trapped.
 UnitBox getHandlerUnitBox()
          Returns the box holding the exception handler's unit.
 java.util.List getUnitBoxes()
          Returns the boxes for first, last and handler units.
 void setBeginUnit(Unit beginUnit)
          Sets the first unit being trapped to beginUnit.
 void setEndUnit(Unit endUnit)
          Sets the last unit being trapped to endUnit.
 void setException(SootClass exception)
          Sets the exception being caught to exception.
 void setHandlerUnit(Unit handlerUnit)
          Sets the unit handling the exception to handlerUnit.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exception

protected SootClass exception
The exception being caught.

beginUnitBox

protected UnitBox beginUnitBox
The first unit being trapped.

endUnitBox

protected UnitBox endUnitBox
The unit just before the last unit being trapped.

handlerUnitBox

protected UnitBox handlerUnitBox
The unit to which execution flows after the caught exception is triggered.

unitBoxes

protected java.util.List unitBoxes
The list of unitBoxes referred to in this Trap (begin, end and handler.
Constructor Detail

AbstractTrap

protected AbstractTrap(SootClass exception,
                       UnitBox beginUnitBox,
                       UnitBox endUnitBox,
                       UnitBox handlerUnitBox)
Creates an AbstractTrap with the given exception, handler, begin and end units.
Method Detail

getBeginUnit

public Unit getBeginUnit()
Description copied from interface: Trap
Returns the first trapped unit.
Specified by:
getBeginUnit in interface Trap

getEndUnit

public Unit getEndUnit()
Description copied from interface: Trap
Returns the last trapped unit.
Specified by:
getEndUnit in interface Trap

getHandlerUnit

public Unit getHandlerUnit()
Description copied from interface: Trap
Returns the unit handling the exception being trapped.
Specified by:
getHandlerUnit in interface Trap

getHandlerUnitBox

public UnitBox getHandlerUnitBox()
Description copied from interface: Trap
Returns the box holding the exception handler's unit.
Specified by:
getHandlerUnitBox in interface Trap

getBeginUnitBox

public UnitBox getBeginUnitBox()
Description copied from interface: Trap
Returns the box holding this trap's first trapped unit.
Specified by:
getBeginUnitBox in interface Trap

getEndUnitBox

public UnitBox getEndUnitBox()
Description copied from interface: Trap
Returns the box holding this trap's last trapped unit.
Specified by:
getEndUnitBox in interface Trap

getUnitBoxes

public java.util.List getUnitBoxes()
Description copied from interface: Trap
Returns the boxes for first, last and handler units.
Specified by:
getUnitBoxes in interface Trap

getException

public SootClass getException()
Description copied from interface: Trap
Returns the exception being caught.
Specified by:
getException in interface Trap

setBeginUnit

public void setBeginUnit(Unit beginUnit)
Description copied from interface: Trap
Sets the first unit being trapped to beginUnit.
Specified by:
setBeginUnit in interface Trap

setEndUnit

public void setEndUnit(Unit endUnit)
Description copied from interface: Trap
Sets the last unit being trapped to endUnit.
Specified by:
setEndUnit in interface Trap

setHandlerUnit

public void setHandlerUnit(Unit handlerUnit)
Description copied from interface: Trap
Sets the unit handling the exception to handlerUnit.
Specified by:
setHandlerUnit in interface Trap

setException

public void setException(SootClass exception)
Description copied from interface: Trap
Sets the exception being caught to exception.
Specified by:
setException in interface Trap

clone

public java.lang.Object clone()
Description copied from interface: Trap
Performs a shallow clone of this trap.
Specified by:
clone in interface Trap
Overrides:
clone in class java.lang.Object