Package serp.bytecode
Class Exceptions
java.lang.Object
serp.bytecode.Attributes
serp.bytecode.Attribute
serp.bytecode.Exceptions
- All Implemented Interfaces:
BCEntity,VisitAcceptor
Attribute declaring the checked exceptions a method can throw.
- Author:
- Abe White
-
Method Summary
Modifier and TypeMethodDescriptionvoidacceptVisit(BCVisitor visit) Accept a visit from aBCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this one.voidaddException(Class type) Add an exception to those thrown by this method.voidaddException(String type) Add an exception type to those thrown by this method.voidaddException(BCClass type) Add an exception to those thrown by this method.voidclear()Clear this method of all exception declarations.BCClass[]Return bytecode for the exception types of this method, or an empty array if none.int[]Return the indexes in the classConstantPoolof theClassEntrys for the exception types thrown by this method, or an empty array if none.String[]Return the names of the exception types for this method, or an empty array if none.Class[]Return theClassobjects for the exception types for this method, or an empty array if none.Return the owning method.booleanremoveException(Class type) Remove an exception thrown by this method.booleanremoveException(String type) Remove an exception type thrown by this method.booleanremoveException(BCClass type) Remove an exception thrown by this method.voidsetExceptionIndexes(int[] exceptionIndexes) Set the indexes in the classConstantPoolof theClassEntrys for the exception types thrown by this method.voidsetExceptions(Class[] exceptions) Set the checked exceptions thrown by this method.voidsetExceptions(String[] exceptions) Set the checked exceptions thrown by this method.voidsetExceptions(BCClass[] exceptions) Set the checked exceptions thrown by this method.booleanthrowsException(Class type) Return true if the method declares that it throws the given exception type.booleanthrowsException(String type) Return true if the method declares that it throws the given exception type.booleanthrowsException(BCClass type) Return true if the method declares that it throws the given exception type.Methods inherited from class serp.bytecode.Attribute
getClassLoader, getName, getNameIndex, getOwner, getPool, getProject, isValidMethods inherited from class serp.bytecode.Attributes
addAttribute, addAttribute, clearAttributes, getAttribute, getAttributes, getAttributes, removeAttribute, removeAttribute, setAttributes
-
Method Details
-
getMethod
Return the owning method. -
getExceptionIndexes
public int[] getExceptionIndexes()Return the indexes in the classConstantPoolof theClassEntrys for the exception types thrown by this method, or an empty array if none. -
setExceptionIndexes
public void setExceptionIndexes(int[] exceptionIndexes) Set the indexes in the classConstantPoolof theClassEntrys for the exception types thrown by this method. Use null or an empty array for none. -
getExceptionNames
Return the names of the exception types for this method, or an empty array if none. The names will be in a form suitable for aClass.forName(java.lang.String)call. -
getExceptionTypes
Return theClassobjects for the exception types for this method, or an empty array if none. -
getExceptionBCs
Return bytecode for the exception types of this method, or an empty array if none. -
setExceptions
Set the checked exceptions thrown by this method. Use null or an empty array for none. -
setExceptions
Set the checked exceptions thrown by this method. Use null or an empty array for none. -
setExceptions
Set the checked exceptions thrown by this method. Use null or an empty array for none. -
clear
public void clear()Clear this method of all exception declarations. -
removeException
Remove an exception type thrown by this method.- Returns:
- true if the method had the exception type, false otherwise
-
removeException
Remove an exception thrown by this method.- Returns:
- true if the method had the exception type, false otherwise
-
removeException
Remove an exception thrown by this method.- Returns:
- true if the method had the exception type, false otherwise
-
addException
Add an exception type to those thrown by this method. -
addException
Add an exception to those thrown by this method. -
addException
Add an exception to those thrown by this method. -
throwsException
Return true if the method declares that it throws the given exception type. -
throwsException
Return true if the method declares that it throws the given exception type. -
throwsException
Return true if the method declares that it throws the given exception type. -
acceptVisit
Description copied from interface:VisitAcceptorAccept a visit from aBCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this one.
-