1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.bcel.verifier.structurals;
18
19
20 import org.apache.bcel.generic.InstructionHandle;
21 import org.apache.bcel.generic.ObjectType;
22
23 /***
24 * This class represents an exception handler; that is, an ObjectType
25 * representing a subclass of java.lang.Throwable and the instruction
26 * the handler starts off (represented by an InstructionContext).
27 *
28 * @version $Id: ExceptionHandler.java 371539 2006-01-23 14:08:00Z tcurdt $
29 * @author Enver Haase
30 */
31 public class ExceptionHandler{
32 /*** The type of the exception to catch. NULL means ANY. */
33 private ObjectType catchtype;
34
35 /*** The InstructionHandle where the handling begins. */
36 private InstructionHandle handlerpc;
37
38 /*** Leave instance creation to JustIce. */
39 ExceptionHandler(ObjectType catch_type, InstructionHandle handler_pc){
40 catchtype = catch_type;
41 handlerpc = handler_pc;
42 }
43
44 /***
45 * Returns the type of the exception that's handled. <B>'null' means 'ANY'.</B>
46 */
47 public ObjectType getExceptionType(){
48 return catchtype;
49 }
50
51 /***
52 * Returns the InstructionHandle where the handler starts off.
53 */
54 public InstructionHandle getHandlerStart(){
55 return handlerpc;
56 }
57 }