public interface CtTry extends CtStatement, TemplateParameter<Void>
try
statement.Modifier and Type | Method and Description |
---|---|
boolean |
addCatcher(CtCatch catcher)
Adds a catch block.
|
boolean |
addResource(CtLocalVariable<? extends AutoCloseable> resource)
Adds a resource.
|
CtBlock<?> |
getBody()
Sets the tried body.
|
List<CtCatch> |
getCatchers()
Gets the catchers of this
try . |
CtBlock<?> |
getFinalizer()
Gets the finalizer block of this
try (
finally part). |
List<CtLocalVariable<? extends AutoCloseable>> |
getResources()
Gets the auto-closeable resources of this
try . |
boolean |
removeCatcher(CtCatch catcher)
Removes a catch block.
|
boolean |
removeResource(CtLocalVariable<? extends AutoCloseable> resource)
Removes a resource.
|
void |
setBody(CtBlock<?> body)
Sets the tried body.
|
void |
setCatchers(List<CtCatch> catchers)
Sets the catchers of this
try . |
void |
setFinalizer(CtBlock<?> finalizer)
Sets the finalizer block of this
try (
finally part). |
void |
setResources(List<CtLocalVariable<? extends AutoCloseable>> resources)
Sets the auto-closeable resources of this
try . |
getLabel, insertAfter, insertAfter, insertBefore, insertBefore, setLabel
partiallyEvaluate
accept, addAnnotation, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getDocComment, getElements, getParent, getParent, getPosition, getReferencedTypes, getReferences, getSignature, hasParent, isImplicit, isParentInitialized, isRootElement, removeAnnotation, replace, setAnnotations, setDocComment, setImplicit, setParent, setPosition, setPositions, setRootElement, updateAllParentsBelow
getFactory, setFactory
compareTo
getSubstitution, S
List<CtLocalVariable<? extends AutoCloseable>> getResources()
try
. Available
from Java 7 with the try-with-resource statement.void setResources(List<CtLocalVariable<? extends AutoCloseable>> resources)
try
. Available
from Java 7 with the try-with-resource statement.boolean addResource(CtLocalVariable<? extends AutoCloseable> resource)
boolean removeResource(CtLocalVariable<? extends AutoCloseable> resource)
boolean addCatcher(CtCatch catcher)
boolean removeCatcher(CtCatch catcher)
CtBlock<?> getBody()
void setBody(CtBlock<?> body)
CtBlock<?> getFinalizer()
try
(
finally
part).void setFinalizer(CtBlock<?> finalizer)
try
(
finally
part).Copyright © 2007–2014 Inria. All rights reserved.