Interface CtCodeElement

All Superinterfaces:
Cloneable, CtElement, CtQueryable, CtVisitable, FactoryAccessor, Serializable, SourcePositionHolder
All Known Subinterfaces:
CtAnnotation<A>, CtAnnotationFieldAccess<T>, CtArrayAccess<T,​E>, CtArrayRead<T>, CtArrayWrite<T>, CtAssert<T>, CtAssignment<T,​A>, CtBinaryOperator<T>, CtBlock<R>, CtBreak, CtCase<S>, CtCatch, CtCatchVariable<T>, CtCFlowBreak, CtClass<T>, CtCodeSnippetExpression<T>, CtCodeSnippetStatement, CtComment, CtConditional<T>, CtConstructorCall<T>, CtContinue, CtDo, CtEnum<T>, CtExecutableReferenceExpression<T,​E>, CtExpression<T>, CtFieldAccess<T>, CtFieldRead<T>, CtFieldWrite<T>, CtFor, CtForEach, CtIf, CtInterface<T>, CtInvocation<T>, CtJavaDoc, CtLabelledFlowBreak, CtLambda<T>, CtLiteral<T>, CtLocalVariable<T>, CtLoop, CtNewArray<T>, CtNewClass<T>, CtOperatorAssignment<T,​A>, CtRecord, CtReturn<R>, CtStatement, CtStatementList, CtSuperAccess<T>, CtSwitch<S>, CtSwitchExpression<T,​S>, CtSynchronized, CtTargetedExpression<T,​E>, CtTextBlock, CtThisAccess<T>, CtThrow, CtTry, CtTryWithResource, CtTypeAccess<A>, CtTypePattern, CtUnaryOperator<T>, CtVariableAccess<T>, CtVariableRead<T>, CtVariableWrite<T>, CtWhile, CtYieldStatement
All Known Implementing Classes:
CtAnnotationFieldAccessImpl, CtAnnotationImpl, CtArrayAccessImpl, CtArrayReadImpl, CtArrayWriteImpl, CtAssertImpl, CtAssignmentImpl, CtBinaryOperatorImpl, CtBlockImpl, CtBreakImpl, CtCaseImpl, CtCatchImpl, CtCatchVariableImpl, CtClassImpl, CtCodeElementImpl, CtCodeSnippetExpressionImpl, CtCodeSnippetStatementImpl, CtCommentImpl, CtConditionalImpl, CtConstructorCallImpl, CtContinueImpl, CtDoImpl, CtEnumImpl, CtExecutableReferenceExpressionImpl, CtExpressionImpl, CtFieldAccessImpl, CtFieldReadImpl, CtFieldWriteImpl, CtForEachImpl, CtForImpl, CtIfImpl, CtInterfaceImpl, CtInvocationImpl, CtJavaDocImpl, CtLambdaImpl, CtLiteralImpl, CtLocalVariableImpl, CtLoopImpl, CtNewArrayImpl, CtNewClassImpl, CtOperatorAssignmentImpl, CtRecordImpl, CtReturnImpl, CtStatementImpl, CtStatementListImpl, CtSuperAccessImpl, CtSwitchExpressionImpl, CtSwitchImpl, CtSynchronizedImpl, CtTargetedExpressionImpl, CtTextBlockImpl, CtThisAccessImpl, CtThrowImpl, CtTryImpl, CtTryWithResourceImpl, CtTypeAccessImpl, CtTypePatternImpl, CtUnaryOperatorImpl, CtVariableAccessImpl, CtVariableReadImpl, CtVariableWriteImpl, CtWhileImpl, CtYieldStatementImpl

public interface CtCodeElement extends CtElement
This interface is the root interface of the code elements.
  • Method Details

    • partiallyEvaluate

      <R extends CtCodeElement> R partiallyEvaluate()
      Partially evaluates an element and all its sub-elements.
      Type Parameters:
      R - the type of the returned element
      Returns:
      the result of the partial evaluation. The element is always cloned, even if nothing has been evaluated.
      See Also:
      VisitorPartialEvaluator
    • clone

      CtCodeElement 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 CtElement