public class CtTryWithResourceImpl extends CtTryImpl implements CtTryWithResource
ERROR_MESSAGE_TO_STRING, factory, LOGGER, parent
Constructor and Description |
---|
CtTryWithResourceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
accept(CtVisitor visitor)
Accepts a visitor
|
<T extends CtTryWithResource> |
addResource(CtLocalVariable<?> resource)
Adds a resource.
|
CtTryWithResource |
clone()
Clone the element which calls this method in a new object.
|
java.util.List<CtLocalVariable<?>> |
getResources()
Gets the auto-closeable resources of this
try . |
boolean |
removeResource(CtLocalVariable<?> resource)
Removes a resource.
|
<T extends CtTryWithResource> |
setResources(java.util.List<CtLocalVariable<?>> resources)
Sets the auto-closeable resources of this
try . |
addCatcher, getBody, getCatchers, getFinalizer, getSubstitution, removeCatcher, S, setBody, setCatchers, setFinalizer
getLabel, insertAfter, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertBefore, setLabel
partiallyEvaluate
addAnnotation, addComment, asIterable, comment, delete, descendantIterator, emptyList, emptySet, equals, filterChildren, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getFactory, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hashCode, hasParent, isImplicit, isParentInitialized, map, map, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setFactory, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, unmodifiableList, updateAllParentsBelow
finalize, getClass, notify, notifyAll, wait, wait, wait
addCatcher, getBody, getCatchers, getFinalizer, removeCatcher, setCatchers, setFinalizer
comment, getLabel, insertAfter, insertAfter, insertBefore, insertBefore, setLabel
partiallyEvaluate
addAnnotation, addComment, asIterable, delete, descendantIterator, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hasParent, isImplicit, isParentInitialized, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, updateAllParentsBelow
getFactory, setFactory
filterChildren, map, map
S
setBody
public void accept(CtVisitor visitor)
CtVisitable
accept
in interface CtVisitable
accept
in class CtTryImpl
public java.util.List<CtLocalVariable<?>> getResources()
CtTryWithResource
try
. Available
from Java 7 with the try-with-resource statement.getResources
in interface CtTryWithResource
public <T extends CtTryWithResource> T setResources(java.util.List<CtLocalVariable<?>> resources)
CtTryWithResource
try
. Available
from Java 7 with the try-with-resource statement.setResources
in interface CtTryWithResource
public <T extends CtTryWithResource> T addResource(CtLocalVariable<?> resource)
CtTryWithResource
addResource
in interface CtTryWithResource
public boolean removeResource(CtLocalVariable<?> resource)
CtTryWithResource
removeResource
in interface CtTryWithResource
public CtTryWithResource clone()
CtElement
Refactoring.copyType(CtType)
and Refactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.clone
in interface CtCodeElement
clone
in interface CtStatement
clone
in interface CtTry
clone
in interface CtTryWithResource
clone
in interface CtElement
clone
in class CtTryImpl
Copyright © 2007–2021 Inria. All rights reserved.