Package spoon.reflect.code
Interface CtBodyHolder
- All Superinterfaces:
Cloneable
,CtElement
,CtQueryable
,CtVisitable
,FactoryAccessor
,Serializable
,SourcePositionHolder
- All Known Subinterfaces:
CtAnnotationMethod<T>
,CtAnonymousExecutable
,CtCatch
,CtConstructor<T>
,CtDo
,CtExecutable<R>
,CtFor
,CtForEach
,CtLambda<T>
,CtLoop
,CtMethod<T>
,CtTry
,CtTryWithResource
,CtWhile
- All Known Implementing Classes:
CtAnnotationMethodImpl
,CtAnonymousExecutableImpl
,CtCatchImpl
,CtConstructorImpl
,CtDoImpl
,CtExecutableImpl
,CtForEachImpl
,CtForImpl
,CtLambdaImpl
,CtLoopImpl
,CtMethodImpl
,CtTryImpl
,CtTryWithResourceImpl
,CtWhileImpl
,InvisibleArrayConstructorImpl
This abstract code element defines an element, which contains a body
-
Method Summary
Modifier and TypeMethodDescriptiongetBody()
Gets the body of this element<T extends CtBodyHolder>
TsetBody(CtStatement body)
Sets the body of this element.Methods inherited from interface spoon.reflect.declaration.CtElement
addAnnotation, addComment, asIterable, clone, 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
Methods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, map
Methods inherited from interface spoon.reflect.visitor.CtVisitable
accept
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Method Details
-
getBody
CtStatement getBody()Gets the body of this element -
setBody
Sets the body of this element. If body is not a block, it is wrapped in a CtBlock which is semantically equivalent and eases transformation afterwards if required.
-