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
ConstructorsModifierConstructorDescriptionType(NodeList<AnnotationExpr> annotations)protectedType(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 StringasString()clone()getAnnotation(int i)intFinds the element type, meaning: the type without ArrayTypes around it.voidifArrayType(Consumer<ArrayType> action)voidvoidifIntersectionType(Consumer<IntersectionType> action)voidifPrimitiveType(Consumer<PrimitiveType> action)voidifReferenceType(Consumer<ReferenceType> action)voidifTypeParameter(Consumer<TypeParameter> action)voidifUnionType(Consumer<UnionType> action)voidifUnknownType(Consumer<UnknownType> action)voidvoidifVoidType(Consumer<VoidType> action)voidifWildcardType(Consumer<WildcardType> action)booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanabstract ResolvedTyperesolve()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, walkMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.javaparser.HasParentNode
findAncestor, findAncestor, findAncestor, hasParentNode, isDescendantOfMethods 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:
getMetaModelin 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:
resolvein interfaceResolvable<ResolvedType>
-
toArrayType
-
toClassOrInterfaceType
-
toIntersectionType
-
toPrimitiveType
-
toReferenceType
-
toTypeParameter
-
toUnionType
-
toUnknownType
-
toVoidType
-
toWildcardType
-
isVarType
public boolean isVarType() -
asVarType
-
toVarType
-
ifVarType
-