Package com.github.javaparser.ast.type
Class Type
- java.lang.Object
-
- com.github.javaparser.ast.Node
-
- com.github.javaparser.ast.type.Type
-
- All Implemented Interfaces:
NodeWithRange<Node>
,NodeWithTokenRange<Node>
,Observable
,Visitable
,HasParentNode<Node>
,Cloneable
- Direct Known Subclasses:
IntersectionType
,PrimitiveType
,ReferenceType
,UnionType
,UnknownType
,VoidType
,WildcardType
public abstract class Type extends Node
Base class for types.- Author:
- Julio Vilmar Gesser
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.github.javaparser.ast.Node
Node.ObserverRegistrationMode, Node.Parsedness
-
-
Field Summary
-
Fields inherited from class com.github.javaparser.ast.Node
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration
-
-
Constructor Summary
Constructors Modifier Constructor Description Type(NodeList<AnnotationExpr> annotations)
protected
Type(TokenRange range)
Several sub classes do not support annotations.Type(TokenRange tokenRange, NodeList<AnnotationExpr> annotations)
This constructor is used by the parser and is considered private.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
asString()
Type
clone()
AnnotationExpr
getAnnotation(int i)
NodeList<AnnotationExpr>
getAnnotations()
int
getArrayLevel()
Type
getElementType()
Finds the element type, meaning: the type without ArrayTypes around it.TypeMetaModel
getMetaModel()
boolean
remove(Node node)
boolean
replace(Node node, Node replacementNode)
Type
setAnnotations(NodeList<AnnotationExpr> annotations)
-
Methods inherited from class com.github.javaparser.ast.Node
addOrphanComment, customInitialization, equals, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getNodeLists, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getRange, getTokenRange, hasComment, hashCode, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, toString, toString, tryAddImportToParentCompilationUnit, unregister
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.javaparser.HasParentNode
getAncestorOfType
-
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithRange
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
-
-
-
-
Constructor Detail
-
Type
protected Type(TokenRange range)
Several sub classes do not support annotations. This is a support constructor for them.
-
Type
public Type(NodeList<AnnotationExpr> annotations)
-
Type
@Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") public Type(TokenRange tokenRange, NodeList<AnnotationExpr> annotations)
This constructor is used by the parser and is considered private.
-
-
Method Detail
-
getAnnotations
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<AnnotationExpr> getAnnotations()
-
getAnnotation
public AnnotationExpr getAnnotation(int i)
-
setAnnotations
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public Type setAnnotations(NodeList<AnnotationExpr> annotations)
-
getElementType
public Type getElementType()
Finds the element type, meaning: the type without ArrayTypes around it.In "
int[] a[];
", the element type is int.
-
getArrayLevel
public int getArrayLevel()
-
remove
@Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") public boolean remove(Node node)
-
asString
public abstract String asString()
-
clone
@Generated("com.github.javaparser.generator.core.node.CloneGenerator") public Type clone()
-
getMetaModel
@Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") public TypeMetaModel getMetaModel()
- Overrides:
getMetaModel
in classNode
- Returns:
- get JavaParser specific node introspection information.
-
replace
@Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") public boolean replace(Node node, Node replacementNode)
-
-