javassist.bytecode

Class ExceptionTable

public class ExceptionTable extends Object implements Cloneable

exception_table[] of Code_attribute.
Constructor Summary
ExceptionTable(ConstPool cp)
Constructs an exception_table[].
Method Summary
voidadd(int index, ExceptionTable table, int offset)
Copies the given exception table at the specified position in the table.
voidadd(int index, int start, int end, int handler, int type)
Adds a new entry at the specified position in the table.
voidadd(int start, int end, int handler, int type)
Appends a new entry at the end of the table.
intcatchType(int nth)
Returns catchType of the n-th entry.
Objectclone()
Creates and returns a copy of this object.
ExceptionTablecopy(ConstPool newCp, Map classnames)
Makes a copy of this exception_table[].
intendPc(int nth)
Returns endPc of the n-th entry.
inthandlerPc(int nth)
Returns handlerPc of the n-th entry.
voidremove(int index)
Removes the entry at the specified position in the table.
voidsetCatchType(int nth, int value)
Sets catchType of the n-th entry.
voidsetEndPc(int nth, int value)
Sets endPc of the n-th entry.
voidsetHandlerPc(int nth, int value)
Sets handlerPc of the n-th entry.
voidsetStartPc(int nth, int value)
Sets startPc of the n-th entry.
intsize()
Returns exception_table_length, which is the number of entries in the exception_table[].
intstartPc(int nth)
Returns startPc of the n-th entry.

Constructor Detail

ExceptionTable

public ExceptionTable(ConstPool cp)
Constructs an exception_table[].

Parameters: cp constant pool table.

Method Detail

add

public void add(int index, ExceptionTable table, int offset)
Copies the given exception table at the specified position in the table.

Parameters: index index (>= 0) at which the entry is to be inserted. offset the offset added to the code position.

add

public void add(int index, int start, int end, int handler, int type)
Adds a new entry at the specified position in the table.

Parameters: index index (>= 0) at which the entry is to be inserted. start startPc end endPc handler handlerPc type catchType

add

public void add(int start, int end, int handler, int type)
Appends a new entry at the end of the table.

Parameters: start startPc end endPc handler handlerPc type catchType

catchType

public int catchType(int nth)
Returns catchType of the n-th entry.

Parameters: nth the n-th (>= 0).

clone

public Object clone()
Creates and returns a copy of this object. The constant pool object is shared between this object and the cloned object.

copy

public ExceptionTable copy(ConstPool newCp, Map classnames)
Makes a copy of this exception_table[]. Class names are replaced according to the given Map object.

Parameters: newCp the constant pool table used by the new copy. classnames pairs of replaced and substituted class names.

endPc

public int endPc(int nth)
Returns endPc of the n-th entry.

Parameters: nth the n-th (>= 0).

handlerPc

public int handlerPc(int nth)
Returns handlerPc of the n-th entry.

Parameters: nth the n-th (>= 0).

remove

public void remove(int index)
Removes the entry at the specified position in the table.

Parameters: index the index of the removed entry.

setCatchType

public void setCatchType(int nth, int value)
Sets catchType of the n-th entry.

Parameters: nth the n-th (>= 0). value new value.

setEndPc

public void setEndPc(int nth, int value)
Sets endPc of the n-th entry.

Parameters: nth the n-th (>= 0). value new value.

setHandlerPc

public void setHandlerPc(int nth, int value)
Sets handlerPc of the n-th entry.

Parameters: nth the n-th (>= 0). value new value.

setStartPc

public void setStartPc(int nth, int value)
Sets startPc of the n-th entry.

Parameters: nth the n-th (>= 0). value new value.

size

public int size()
Returns exception_table_length, which is the number of entries in the exception_table[].

startPc

public int startPc(int nth)
Returns startPc of the n-th entry.

Parameters: nth the n-th (>= 0).

Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.