Package javassist.bytecode
Class ExceptionsAttribute
- java.lang.Object
-
- javassist.bytecode.AttributeInfo
-
- javassist.bytecode.ExceptionsAttribute
-
public class ExceptionsAttribute extends AttributeInfo
Exceptions_attribute
.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
tag
The name of this attribute"Exceptions"
.-
Fields inherited from class javassist.bytecode.AttributeInfo
constPool, info, name
-
-
Constructor Summary
Constructors Modifier Constructor Description ExceptionsAttribute(ConstPool cp)
Constructs a new exceptions attribute.(package private)
ExceptionsAttribute(ConstPool cp, int n, java.io.DataInputStream in)
private
ExceptionsAttribute(ConstPool cp, ExceptionsAttribute src, java.util.Map classnames)
Constructs a copy of an exceptions attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeInfo
copy(ConstPool newCp, java.util.Map classnames)
Makes a copy.private void
copyFrom(ExceptionsAttribute srcAttr, java.util.Map classnames)
Copies the contents from a source attribute.int
getException(int nth)
Returns the value ofexception_index_table[nth]
.int[]
getExceptionIndexes()
Returnsexception_index_table[]
.java.lang.String[]
getExceptions()
Returns the names of exceptions that the method may throw.void
setExceptionIndexes(int[] elist)
Setsexception_index_table[]
.void
setExceptions(java.lang.String[] elist)
Sets the names of exceptions that the method may throw.int
tableLength()
Returnsnumber_of_exceptions
.-
Methods inherited from class javassist.bytecode.AttributeInfo
copyAll, get, getConstPool, getLength, getName, getRefClasses, getRefClasses, length, lookup, read, remove, renameClass, renameClass, renameClass, renameClass, set, write, writeAll
-
-
-
-
Field Detail
-
tag
public static final java.lang.String tag
The name of this attribute"Exceptions"
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExceptionsAttribute
ExceptionsAttribute(ConstPool cp, int n, java.io.DataInputStream in) throws java.io.IOException
- Throws:
java.io.IOException
-
ExceptionsAttribute
private ExceptionsAttribute(ConstPool cp, ExceptionsAttribute src, java.util.Map classnames)
Constructs a copy of an exceptions attribute.- Parameters:
cp
- constant pool table.src
- source attribute.
-
ExceptionsAttribute
public ExceptionsAttribute(ConstPool cp)
Constructs a new exceptions attribute.- Parameters:
cp
- constant pool table.
-
-
Method Detail
-
copy
public AttributeInfo copy(ConstPool newCp, java.util.Map classnames)
Makes a copy. Class names are replaced according to the givenMap
object.- Overrides:
copy
in classAttributeInfo
- Parameters:
newCp
- the constant pool table used by the new copy.classnames
- pairs of replaced and substituted class names. It can benull
.
-
copyFrom
private void copyFrom(ExceptionsAttribute srcAttr, java.util.Map classnames)
Copies the contents from a source attribute. Specified class names are replaced during the copy.- Parameters:
srcAttr
- source Exceptions attributeclassnames
- pairs of replaced and substituted class names.
-
getExceptionIndexes
public int[] getExceptionIndexes()
Returnsexception_index_table[]
.
-
getExceptions
public java.lang.String[] getExceptions()
Returns the names of exceptions that the method may throw.
-
setExceptionIndexes
public void setExceptionIndexes(int[] elist)
Setsexception_index_table[]
.
-
setExceptions
public void setExceptions(java.lang.String[] elist)
Sets the names of exceptions that the method may throw.
-
tableLength
public int tableLength()
Returnsnumber_of_exceptions
.
-
getException
public int getException(int nth)
Returns the value ofexception_index_table[nth]
.
-
-