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