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

public interface CtBodyHolder extends CtElement
This abstract code element defines an element, which contains a body
  • Method Details

    • getBody

      CtStatement getBody()
      Gets the body of this element
    • setBody

      <T extends CtBodyHolder> T setBody(CtStatement body)
      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.