Package javassist.bytecode
Class ExceptionTable
java.lang.Object
javassist.bytecode.ExceptionTable
- All Implemented Interfaces:
Cloneable
exception_table[]
of Code_attribute
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int start, int end, int handler, int type) Appends a new entry at the end of the table.void
add
(int index, int start, int end, int handler, int type) Adds a new entry at the specified position in the table.void
add
(int index, ExceptionTable table, int offset) Copies the given exception table at the specified position in the table.int
catchType
(int nth) ReturnscatchType
of the n-th entry.clone()
Creates and returns a copy of this object.Makes a copy of thisexception_table[]
.int
endPc
(int nth) ReturnsendPc
of the n-th entry.int
handlerPc
(int nth) ReturnshandlerPc
of the n-th entry.void
remove
(int index) Removes the entry at the specified position in the table.void
setCatchType
(int nth, int value) SetscatchType
of the n-th entry.void
setEndPc
(int nth, int value) SetsendPc
of the n-th entry.void
setHandlerPc
(int nth, int value) SetshandlerPc
of the n-th entry.void
setStartPc
(int nth, int value) SetsstartPc
of the n-th entry.int
size()
Returnsexception_table_length
, which is the number of entries in theexception_table[]
.int
startPc
(int nth) ReturnsstartPc
of the n-th entry.
-
Constructor Details
-
ExceptionTable
Constructs anexception_table[]
.- Parameters:
cp
- constant pool table.
-
-
Method Details
-
clone
Creates and returns a copy of this object. The constant pool object is shared between this object and the cloned object.- Throws:
CloneNotSupportedException
-
size
public int size()Returnsexception_table_length
, which is the number of entries in theexception_table[]
. -
startPc
public int startPc(int nth) ReturnsstartPc
of the n-th entry.- Parameters:
nth
- the n-th (>= 0).
-
setStartPc
public void setStartPc(int nth, int value) SetsstartPc
of the n-th entry.- Parameters:
nth
- the n-th (>= 0).value
- new value.
-
endPc
public int endPc(int nth) ReturnsendPc
of the n-th entry.- Parameters:
nth
- the n-th (>= 0).
-
setEndPc
public void setEndPc(int nth, int value) SetsendPc
of the n-th entry.- Parameters:
nth
- the n-th (>= 0).value
- new value.
-
handlerPc
public int handlerPc(int nth) ReturnshandlerPc
of the n-th entry.- Parameters:
nth
- the n-th (>= 0).
-
setHandlerPc
public void setHandlerPc(int nth, int value) SetshandlerPc
of the n-th entry.- Parameters:
nth
- the n-th (>= 0).value
- new value.
-
catchType
public int catchType(int nth) ReturnscatchType
of the n-th entry.- Parameters:
nth
- the n-th (>= 0).- Returns:
- an index into the
constant_pool
table, or zero if this exception handler is for all exceptions.
-
setCatchType
public void setCatchType(int nth, int value) SetscatchType
of the n-th entry.- Parameters:
nth
- the n-th (>= 0).value
- new value.
-
add
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
-
remove
public void remove(int index) Removes the entry at the specified position in the table.- Parameters:
index
- the index of the removed entry.
-
copy
Makes a copy of thisexception_table[]
. Class names are replaced according to the givenMap
object.- Parameters:
newCp
- the constant pool table used by the new copy.classnames
- pairs of replaced and substituted class names.
-