-
- All Known Implementing Classes:
AnnotationMemberDeclaration,CastExpr,ClassExpr,InstanceOfExpr,MethodDeclaration,ObjectCreationExpr,Parameter,PatternExpr,ReceiverParameter,RecordPatternExpr,TypeExpr,TypePatternExpr,VariableDeclarator
public interface NodeWithType<N extends Node,T extends Type>A node with a type.The main reason for this interface is to permit users to manipulate homogeneously all nodes with getType/setType methods
- Since:
- 2.3.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description TgetType()Gets the typedefault StringgetTypeAsString()default NsetType(Class<?> typeClass)Sets this type to this class and try to import it to theCompilationUnitif neededdefault NsetType(String typeString)NsetType(T type)Sets the typevoidtryAddImportToParentCompilationUnit(Class<?> clazz)
-
-
-
Method Detail
-
getType
T getType()
Gets the type- Returns:
- the type
-
tryAddImportToParentCompilationUnit
void tryAddImportToParentCompilationUnit(Class<?> clazz)
-
setType
default N setType(Class<?> typeClass)
Sets this type to this class and try to import it to theCompilationUnitif needed- Parameters:
typeClass- the type- Returns:
- this
-
getTypeAsString
default String getTypeAsString()
-
-