CallableDeclaration
, ConstructorDeclaration
, MethodDeclaration
public interface NodeWithThrownExceptions<N extends Node>
Modifier and Type | Method | Description |
---|---|---|
default N |
addThrownException(ReferenceType throwType) |
Adds this type to the throws clause
|
default N |
addThrownException(Class<? extends Throwable> clazz) |
Adds this class to the throws clause
|
default ReferenceType |
getThrownException(int i) |
|
NodeList<ReferenceType> |
getThrownExceptions() |
|
default boolean |
isThrown(Class<? extends Throwable> clazz) |
Check whether this elements throws this exception class.
|
default boolean |
isThrown(String throwableName) |
Check whether this elements throws this exception class
Note that this is simply a text compare,
no actual type resolution takes place.
|
N |
setThrownExceptions(NodeList<ReferenceType> thrownExceptions) |
|
void |
tryAddImportToParentCompilationUnit(Class<?> clazz) |
N setThrownExceptions(NodeList<ReferenceType> thrownExceptions)
NodeList<ReferenceType> getThrownExceptions()
void tryAddImportToParentCompilationUnit(Class<?> clazz)
default ReferenceType getThrownException(int i)
default N addThrownException(ReferenceType throwType)
throwType
- the exception typedefault N addThrownException(Class<? extends Throwable> clazz)
clazz
- the exception classdefault boolean isThrown(Class<? extends Throwable> clazz)
clazz
- the class of the exceptiondefault boolean isThrown(String throwableName)
throwableName
- the class of the exceptionCopyright © 2007–2019. All rights reserved.