-
- All Known Implementing Classes:
AnnotationMemberDeclaration
,CastExpr
,ClassExpr
,InstanceOfExpr
,MethodDeclaration
,ObjectCreationExpr
,Parameter
,ReceiverParameter
,TypeExpr
,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 T
getType()
Gets the typedefault String
getTypeAsString()
default N
setType(Class<?> typeClass)
Sets this type to this class and try to import it to theCompilationUnit
if neededdefault N
setType(String typeString)
N
setType(T type)
Sets the typevoid
tryAddImportToParentCompilationUnit(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 theCompilationUnit
if needed- Parameters:
typeClass
- the type- Returns:
- this
-
getTypeAsString
default String getTypeAsString()
-
-