Package spoon.reflect.code
Interface CtExpression<T>
- Type Parameters:
T
- the "return type" of this expression
- All Superinterfaces:
Cloneable
,CtCodeElement
,CtElement
,CtQueryable
,CtTypedElement<T>
,CtVisitable
,FactoryAccessor
,Serializable
,SourcePositionHolder
,TemplateParameter<T>
- All Known Subinterfaces:
CtAnnotation<A>
,CtAnnotationFieldAccess<T>
,CtArrayAccess<T,E>
,CtArrayRead<T>
,CtArrayWrite<T>
,CtAssignment<T,A>
,CtBinaryOperator<T>
,CtCodeSnippetExpression<T>
,CtConditional<T>
,CtConstructorCall<T>
,CtExecutableReferenceExpression<T,E>
,CtFieldAccess<T>
,CtFieldRead<T>
,CtFieldWrite<T>
,CtInvocation<T>
,CtLambda<T>
,CtLiteral<T>
,CtNewArray<T>
,CtNewClass<T>
,CtOperatorAssignment<T,A>
,CtSuperAccess<T>
,CtSwitchExpression<T,S>
,CtTargetedExpression<T,E>
,CtTextBlock
,CtThisAccess<T>
,CtTypeAccess<A>
,CtTypePattern
,CtUnaryOperator<T>
,CtVariableAccess<T>
,CtVariableRead<T>
,CtVariableWrite<T>
- All Known Implementing Classes:
CtAnnotationFieldAccessImpl
,CtAnnotationImpl
,CtArrayAccessImpl
,CtArrayReadImpl
,CtArrayWriteImpl
,CtAssignmentImpl
,CtBinaryOperatorImpl
,CtCodeSnippetExpressionImpl
,CtConditionalImpl
,CtConstructorCallImpl
,CtExecutableReferenceExpressionImpl
,CtExpressionImpl
,CtFieldAccessImpl
,CtFieldReadImpl
,CtFieldWriteImpl
,CtInvocationImpl
,CtLambdaImpl
,CtLiteralImpl
,CtNewArrayImpl
,CtNewClassImpl
,CtOperatorAssignmentImpl
,CtSuperAccessImpl
,CtSwitchExpressionImpl
,CtTargetedExpressionImpl
,CtTextBlockImpl
,CtThisAccessImpl
,CtTypeAccessImpl
,CtTypePatternImpl
,CtUnaryOperatorImpl
,CtVariableAccessImpl
,CtVariableReadImpl
,CtVariableWriteImpl
This abstract code element defines a typed expression.
-
Method Summary
Modifier and TypeMethodDescription<C extends CtExpression<T>>
CaddTypeCast(CtTypeReference<?> type)
Adds a type cast.clone()
Clone the element which calls this method in a new object.List<CtTypeReference<?>>
Returns the type casts if any.<C extends CtExpression<T>>
CsetTypeCasts(List<CtTypeReference<?>> types)
Sets the type casts.Methods inherited from interface spoon.reflect.code.CtCodeElement
partiallyEvaluate
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.declaration.CtTypedElement
getType, setType
Methods inherited from interface spoon.reflect.visitor.CtVisitable
accept
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
Methods inherited from interface spoon.template.TemplateParameter
S
-
Method Details
-
getTypeCasts
List<CtTypeReference<?>> getTypeCasts()Returns the type casts if any. -
setTypeCasts
Sets the type casts. -
addTypeCast
Adds a type cast. -
clone
CtExpression<T> 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.- Specified by:
clone
in interfaceCtCodeElement
- Specified by:
clone
in interfaceCtElement
-