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
public interface CtExpression<T> extends CtCodeElement, CtTypedElement<T>, TemplateParameter<T>
This abstract code element defines a typed expression.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <C extends CtExpression<T>>
CaddTypeCast(CtTypeReference<?> type)
Adds a type cast.CtExpression<T>
clone()
Clone the element which calls this method in a new object.List<CtTypeReference<?>>
getTypeCasts()
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 Detail
-
getTypeCasts
List<CtTypeReference<?>> getTypeCasts()
Returns the type casts if any.
-
setTypeCasts
<C extends CtExpression<T>> C setTypeCasts(List<CtTypeReference<?>> types)
Sets the type casts.
-
addTypeCast
<C extends CtExpression<T>> C addTypeCast(CtTypeReference<?> type)
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
-
-