Package gnu.bytecode
Class ExceptionsAttr
java.lang.Object
gnu.bytecode.Attribute
gnu.bytecode.ExceptionsAttr
Represents the contents of a standard "Exceptions" attribute.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd any needed constant pool entries for this Attribute.final ClassType[]The types of the exceptions in this attr.final intThe size of this Attribute (in bytes) is 2 (for number_of_exception) plus 2 * number_of_exceptions.voidprint(ClassTypeWriter dst) voidsetExceptions(short[] indices, ClassType cl) Set the Exceptions attribute to refer to classes whose indices in the constant pool of `cl' are given by `indices'.voidsetExceptions(ClassType[] excep_types) Set the Exceptions attribute to refer to the given exception types.voidwrite(DataOutputStream dstr) Write out the contents of the Attribute.Methods inherited from class gnu.bytecode.Attribute
addToFrontOf, assignConstants, count, get, getConstants, getContainer, getLengthAll, getName, getNameIndex, getNext, isSkipped, setContainer, setName, setNameIndex, setNext, setSkipped, setSkipped, writeAll
-
Constructor Details
-
ExceptionsAttr
Add a new ExceptionsAttr to a Method.
-
-
Method Details
-
setExceptions
Set the Exceptions attribute to refer to classes whose indices in the constant pool of `cl' are given by `indices'. -
setExceptions
Set the Exceptions attribute to refer to the given exception types.- Parameters:
excep_types- the types of the exceptions.
-
assignConstants
Description copied from class:AttributeAdd any needed constant pool entries for this Attribute. Overridden by sub-classes. Do any other cleanup needed before writing out a .class file.- Overrides:
assignConstantsin classAttribute
-
getLength
public final int getLength()The size of this Attribute (in bytes) is 2 (for number_of_exception) plus 2 * number_of_exceptions. -
getExceptions
The types of the exceptions in this attr. -
write
Description copied from class:AttributeWrite out the contents of the Attribute. Does not write the 6-byte attribute header.- Specified by:
writein classAttribute- Throws:
IOException
-
print
-