Package com.tonic.analysis.ssa.cfg
Class ExceptionHandler
- java.lang.Object
-
- com.tonic.analysis.ssa.cfg.ExceptionHandler
-
public class ExceptionHandler extends Object
One exception-table entry: a protected try region and the block handling its catch type.
-
-
Constructor Summary
Constructors Constructor Description ExceptionHandler(IRBlock tryStart, IRBlock tryEnd, IRBlock handlerBlock, ReferenceType catchType)Creates an exception handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReferenceTypegetCatchType()IRBlockgetHandlerBlock()Set<IRBlock>getTryBlocks()Returns the full set of blocks making up the protected (try) region, when known.IRBlockgetTryEnd()IRBlockgetTryStart()booleanisCatchAll()Checks if this is a catch-all handler.voidsetCatchType(ReferenceType catchType)voidsetHandlerBlock(IRBlock handlerBlock)voidsetTryBlocks(Set<IRBlock> tryBlocks)voidsetTryEnd(IRBlock tryEnd)voidsetTryStart(IRBlock tryStart)StringtoString()
-
-
-
Constructor Detail
-
ExceptionHandler
public ExceptionHandler(IRBlock tryStart, IRBlock tryEnd, IRBlock handlerBlock, ReferenceType catchType)
Creates an exception handler.- Parameters:
tryStart- the start block of the try regiontryEnd- the end block of the try regionhandlerBlock- the handler block for caught exceptionscatchType- the type of exception to catch, or null for catch-all
-
-
Method Detail
-
getTryStart
public IRBlock getTryStart()
- Returns:
- the try start
-
setTryStart
public void setTryStart(IRBlock tryStart)
- Parameters:
tryStart- the start block of the try region
-
getTryEnd
public IRBlock getTryEnd()
- Returns:
- the try end
-
setTryEnd
public void setTryEnd(IRBlock tryEnd)
- Parameters:
tryEnd- the end block of the try region
-
getHandlerBlock
public IRBlock getHandlerBlock()
- Returns:
- the handler block
-
setHandlerBlock
public void setHandlerBlock(IRBlock handlerBlock)
- Parameters:
handlerBlock- the block entered when the exception is caught
-
getCatchType
public ReferenceType getCatchType()
- Returns:
- the catch type
-
setCatchType
public void setCatchType(ReferenceType catchType)
- Parameters:
catchType- the exception type to catch, or null for catch-all
-
getTryBlocks
public Set<IRBlock> getTryBlocks()
Returns the full set of blocks making up the protected (try) region, when known.- Returns:
- the protected blocks, or null when unknown
-
setTryBlocks
public void setTryBlocks(Set<IRBlock> tryBlocks)
- Parameters:
tryBlocks- the full set of blocks in the protected region, or null when unknown
-
isCatchAll
public boolean isCatchAll()
Checks if this is a catch-all handler.- Returns:
- true if catches all exception types, false otherwise
-
-