Class CtLoopImpl

All Implemented Interfaces:
Serializable, Cloneable, FactoryAccessor, CtBodyHolder, CtCodeElement, CtLoop, CtStatement, SourcePositionHolder, CtElement, CtQueryable, CtVisitable, TemplateParameter<Void>
Direct Known Subclasses:
CtDoImpl, CtForEachImpl, CtForImpl, CtWhileImpl

public abstract class CtLoopImpl extends CtStatementImpl implements CtLoop
See Also:
Serialized Form
  • Constructor Details

    • CtLoopImpl

      public CtLoopImpl()
  • Method Details

    • getBody

      public CtStatement getBody()
      Description copied from interface: CtLoop
      Gets the body of this loop.
      Specified by:
      getBody in interface CtBodyHolder
      Specified by:
      getBody in interface CtLoop
    • setBody

      public <T extends CtBodyHolder> T setBody(CtStatement statement)
      Description copied from interface: CtBodyHolder
      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.
      Specified by:
      setBody in interface CtBodyHolder
    • clone

      public CtLoop clone()
      Description copied from interface: CtElement
      Clone the element which calls this method in a new object. Note that that references are kept as is, and thus, so if you clone whole classes or methods, some parts of the cloned element (eg executable references) may still point to the initial element. In this case, consider using methods Refactoring.copyType(CtType) and Refactoring.copyMethod(CtMethod) instead which does additional work beyond cloning.
      Specified by:
      clone in interface CtCodeElement
      Specified by:
      clone in interface CtElement
      Specified by:
      clone in interface CtLoop
      Specified by:
      clone in interface CtStatement
      Overrides:
      clone in class CtStatementImpl
    • S

      public Void S()
      Description copied from interface: TemplateParameter
      Gets the type of the template parameter. This methods has no runtime meaning (should return a null reference) but is used as a marker in a template code.
      Specified by:
      S in interface TemplateParameter<Void>
    • getSubstitution

      public CtCodeElement getSubstitution(CtType<?> targetType)