Package spoon.reflect.code
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
This interface is the root interface of the code elements.
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone the element which calls this method in a new object.<R extends CtCodeElement>
RPartially evaluates an element and all its sub-elements.Methods inherited from interface spoon.reflect.declaration.CtElement
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
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
-
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 methodsRefactoring.copyType(CtType)
andRefactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.
-