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>
,Resolvable<ResolvedType>
,Cloneable
- Direct Known Subclasses:
IntersectionType
,PrimitiveType
,ReferenceType
,UnionType
,UnknownType
,VarType
,VoidType
,WildcardType
Base class for types.
- Author:
- Julio Vilmar Gesser
-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.javaparser.ast.Node
Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversal
-
Field Summary
Fields inherited from class com.github.javaparser.ast.Node
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, LINE_SEPARATOR_KEY, NODE_BY_BEGIN_POSITION, PHANTOM_KEY, prettyPrinterNoCommentsConfiguration, PRINTER_KEY, SYMBOL_RESOLVER_KEY
-
Constructor Summary
ModifierConstructorDescriptionType(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
Modifier and TypeMethodDescriptionabstract String
asString()
clone()
getAnnotation(int i)
int
Finds the element type, meaning: the type without ArrayTypes around it.void
ifArrayType(Consumer<ArrayType> action)
void
void
ifIntersectionType(Consumer<IntersectionType> action)
void
ifPrimitiveType(Consumer<PrimitiveType> action)
void
ifReferenceType(Consumer<ReferenceType> action)
void
ifTypeParameter(Consumer<TypeParameter> action)
void
ifUnionType(Consumer<UnionType> action)
void
ifUnknownType(Consumer<UnknownType> action)
void
void
ifVoidType(Consumer<VoidType> action)
void
ifWildcardType(Consumer<WildcardType> action)
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
abstract ResolvedType
resolve()
setAnnotations(NodeList<AnnotationExpr> annotations)
Methods inherited from class com.github.javaparser.ast.Node
addOrphanComment, containsData, createDefaultPrinter, createDefaultPrinter, customInitialization, equals, findAll, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getDataKeys, getDefaultPrinterConfiguration, getLineEndingStyle, getLineEndingStyleOrDefault, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getPrinter, getPrinter, getRange, getSymbolResolver, getTokenRange, hashCode, hasScope, isAncestorOf, isPhantom, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walk
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.javaparser.HasParentNode
findAncestor, findAncestor, findAncestor, hasParentNode, isDescendantOf
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithRange
containsWithin, containsWithinRange, getBegin, getEnd, hasRange
-
Constructor Details
-
Type
Several sub classes do not support annotations. This is a support constructor for them. -
Type
-
Type
This constructor is used by the parser and is considered private.
-
-
Method Details
-
getAnnotations
-
getAnnotation
-
setAnnotations
-
getElementType
Finds the element type, meaning: the type without ArrayTypes around it.In "
int[] a[];
", the element type is int. -
getArrayLevel
public int getArrayLevel() -
toDescriptor
-
remove
-
asString
-
clone
-
getMetaModel
- Overrides:
getMetaModel
in classNode
- Returns:
- get JavaParser specific node introspection information.
-
replace
-
isArrayType
public boolean isArrayType() -
asArrayType
-
isClassOrInterfaceType
public boolean isClassOrInterfaceType() -
asClassOrInterfaceType
-
isIntersectionType
public boolean isIntersectionType() -
asIntersectionType
-
isPrimitiveType
public boolean isPrimitiveType() -
asPrimitiveType
-
isReferenceType
public boolean isReferenceType() -
asReferenceType
-
isTypeParameter
public boolean isTypeParameter() -
asTypeParameter
-
isUnionType
public boolean isUnionType() -
asUnionType
-
isUnknownType
public boolean isUnknownType() -
asUnknownType
-
isVoidType
public boolean isVoidType() -
asVoidType
-
isWildcardType
public boolean isWildcardType() -
asWildcardType
-
ifArrayType
-
ifClassOrInterfaceType
-
ifIntersectionType
-
ifPrimitiveType
-
ifReferenceType
-
ifTypeParameter
-
ifUnionType
-
ifUnknownType
-
ifVoidType
-
ifWildcardType
-
resolve
- Specified by:
resolve
in interfaceResolvable<ResolvedType>
-
toArrayType
-
toClassOrInterfaceType
-
toIntersectionType
-
toPrimitiveType
-
toReferenceType
-
toTypeParameter
-
toUnionType
-
toUnknownType
-
toVoidType
-
toWildcardType
-
isVarType
public boolean isVarType() -
asVarType
-
toVarType
-
ifVarType
-