Interface Trap
-
- All Superinterfaces:
UnitBoxOwner
- All Known Implementing Classes:
AbstractTrap,BTrap,GTrap,JTrap
public interface Trap extends UnitBoxOwner
A trap (exception catcher), used within Body classes. Intermediate representations must use an implementation of Trap to describe caught exceptions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Objectclone()Performs a shallow clone of this trap.UnitgetBeginUnit()Returns the first trapped unit, unless thisTrapdoes not trap any units at all.UnitBoxgetBeginUnitBox()Returns the box holding the unit returned bygetBeginUnit().UnitgetEndUnit()Returns the unit following the last trapped unit (that is, the first succeeding untrapped unit in the underlyingChain), unless thisTrapdoes not trap any units at all.UnitBoxgetEndUnitBox()Returns the box holding the unit returned bygetEndUnit().SootClassgetException()Returns the exception being caught.UnitgetHandlerUnit()Returns the unit handling the exception being trapped.UnitBoxgetHandlerUnitBox()Returns the box holding the exception handler unit.List<UnitBox>getUnitBoxes()Returns the boxes for first, last, and handler units.voidsetBeginUnit(Unit beginUnit)Sets the value to be returned bygetBeginUnit()tobeginUnit.voidsetEndUnit(Unit endUnit)Sets the value to be returned bygetEndUnit()toendUnit.voidsetException(SootClass exception)Sets the exception being caught toexception.voidsetHandlerUnit(Unit handlerUnit)Sets the unit handling the exception tohandlerUnit.-
Methods inherited from interface soot.UnitBoxOwner
clearUnitBoxes
-
-
-
-
Method Detail
-
getBeginUnit
Unit getBeginUnit()
Returns the first trapped unit, unless this
Trapdoes not trap any units at all.If this is a degenerate
Trapwhich traps no units (which can occur if all the units originally trapped by the exception handler have been optimized away), returns an untrapped unit. The returned unit will likely be the first unit remaining after the point where the trapped units were once located, but the only guarantee provided is that for such an empty trap,getBeginUnit()will return the same value asgetEndUnit().
-
getEndUnit
Unit getEndUnit()
Returns the unit following the last trapped unit (that is, the first succeeding untrapped unit in the underlying
Chain), unless thisTrapdoes not trap any units at all.In the case of a degenerate
Trapwhich traps no units, returns the same untrapped unit asgetBeginUnit()Note that a weakness of marking the end of the trapped region with the first untrapped unit is that Soot has no good mechanism for describing a
Trapwhich traps the last unit in a method.
-
getHandlerUnit
Unit getHandlerUnit()
Returns the unit handling the exception being trapped.
-
getBeginUnitBox
UnitBox getBeginUnitBox()
Returns the box holding the unit returned bygetBeginUnit().
-
getEndUnitBox
UnitBox getEndUnitBox()
Returns the box holding the unit returned bygetEndUnit().
-
getHandlerUnitBox
UnitBox getHandlerUnitBox()
Returns the box holding the exception handler unit.
-
getUnitBoxes
List<UnitBox> getUnitBoxes()
Returns the boxes for first, last, and handler units.- Specified by:
getUnitBoxesin interfaceUnitBoxOwner
-
getException
SootClass getException()
Returns the exception being caught.
-
setBeginUnit
void setBeginUnit(Unit beginUnit)
Sets the value to be returned bygetBeginUnit()tobeginUnit.
-
setEndUnit
void setEndUnit(Unit endUnit)
Sets the value to be returned bygetEndUnit()toendUnit.
-
setHandlerUnit
void setHandlerUnit(Unit handlerUnit)
Sets the unit handling the exception tohandlerUnit.
-
setException
void setException(SootClass exception)
Sets the exception being caught toexception.
-
clone
Object clone()
Performs a shallow clone of this trap.
-
-