Uses of Class
com.github.javaparser.ast.type.Type
Package
Description
-
Uses of Type in com.github.javaparser
Modifier and TypeMethodDescriptionstatic Type
Parses a Java type name and returns aType
that represents it. -
Uses of Type in com.github.javaparser.ast.body
Modifier and TypeMethodDescriptionAnnotationMemberDeclaration.getType()
MethodDeclaration.getType()
Parameter.getType()
ReceiverParameter.getType()
VariableDeclarator.getType()
Modifier and TypeMethodDescriptionAnnotationDeclaration.addField(Type type, String name, Modifier.Keyword... modifiers)
ModifierConstructorDescriptionAnnotationMemberDeclaration(NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, Type type, SimpleName name, Expression defaultValue)
AnnotationMemberDeclaration(NodeList<Modifier> modifiers, Type type, String name, Expression defaultValue)
AnnotationMemberDeclaration(TokenRange tokenRange, NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, Type type, SimpleName name, Expression defaultValue)
This constructor is used by the parser and is considered private.FieldDeclaration(NodeList<Modifier> modifiers, Type type, String name)
Creates aFieldDeclaration
.MethodDeclaration(NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, Type type, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, BlockStmt body)
MethodDeclaration(NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, Type type, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter)
MethodDeclaration(NodeList<Modifier> modifiers, Type type, String name)
MethodDeclaration(NodeList<Modifier> modifiers, String name, Type type, NodeList<Parameter> parameters)
MethodDeclaration(TokenRange tokenRange, NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, Type type, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter)
This constructor is used by the parser and is considered private.Parameter(NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, Type type, boolean isVarArgs, NodeList<AnnotationExpr> varArgsAnnotations, SimpleName name)
Parameter(NodeList<Modifier> modifiers, Type type, SimpleName name)
Parameter(Type type, SimpleName name)
Creates a newParameter
.Parameter(TokenRange tokenRange, NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, Type type, boolean isVarArgs, NodeList<AnnotationExpr> varArgsAnnotations, SimpleName name)
This constructor is used by the parser and is considered private.ReceiverParameter(NodeList<AnnotationExpr> annotations, Type type, Name name)
ReceiverParameter(Type type, Name name)
ReceiverParameter(Type type, String name)
Creates a newReceiverParameter
.ReceiverParameter(TokenRange tokenRange, NodeList<AnnotationExpr> annotations, Type type, Name name)
This constructor is used by the parser and is considered private.VariableDeclarator(Type type, SimpleName name)
VariableDeclarator(Type type, SimpleName name, Expression initializer)
Defines the declaration of a variable.VariableDeclarator(Type type, String variableName)
VariableDeclarator(Type type, String variableName, Expression initializer)
VariableDeclarator(TokenRange tokenRange, Type type, SimpleName name, Expression initializer)
This constructor is used by the parser and is considered private. -
Uses of Type in com.github.javaparser.ast.expr
Modifier and TypeMethodDescriptionArrayCreationExpr.createdType()
Takes the element type and wraps it in an ArrayType for every array creation level.ArrayCreationExpr.getElementType()
CastExpr.getType()
ClassExpr.getType()
TypeExpr.getType()
Modifier and TypeMethodDescriptionFieldAccessExpr.getTypeArguments()
MethodCallExpr.getTypeArguments()
MethodReferenceExpr.getTypeArguments()
ObjectCreationExpr.getTypeArguments()
Modifier and TypeMethodDescriptionFieldAccessExpr.setTypeArguments(NodeList<Type> typeArguments)
Sets the type argumentsMethodCallExpr.setTypeArguments(NodeList<Type> typeArguments)
Sets the typeArgumentsMethodReferenceExpr.setTypeArguments(NodeList<Type> typeArguments)
Sets the typeArgumentsObjectCreationExpr.setTypeArguments(NodeList<Type> typeArguments)
Sets the typeArgumentsModifierConstructorDescriptionArrayCreationExpr(Type elementType)
ArrayCreationExpr(Type elementType, NodeList<ArrayCreationLevel> levels, ArrayInitializerExpr initializer)
ArrayCreationExpr(TokenRange tokenRange, Type elementType, NodeList<ArrayCreationLevel> levels, ArrayInitializerExpr initializer)
This constructor is used by the parser and is considered private.CastExpr(Type type, Expression expression)
CastExpr(TokenRange tokenRange, Type type, Expression expression)
This constructor is used by the parser and is considered private.ClassExpr(TokenRange tokenRange, Type type)
This constructor is used by the parser and is considered private.TypeExpr(TokenRange tokenRange, Type type)
This constructor is used by the parser and is considered private.VariableDeclarationExpr(Type type, String variableName)
VariableDeclarationExpr(Type type, String variableName, Modifier... modifiers)
ModifierConstructorDescriptionFieldAccessExpr(Expression scope, NodeList<Type> typeArguments, SimpleName name)
FieldAccessExpr(TokenRange tokenRange, Expression scope, NodeList<Type> typeArguments, SimpleName name)
This constructor is used by the parser and is considered private.MethodCallExpr(Expression scope, NodeList<Type> typeArguments, SimpleName name, NodeList<Expression> arguments)
MethodCallExpr(Expression scope, NodeList<Type> typeArguments, String name, NodeList<Expression> arguments)
MethodCallExpr(TokenRange tokenRange, Expression scope, NodeList<Type> typeArguments, SimpleName name, NodeList<Expression> arguments)
This constructor is used by the parser and is considered private.MethodReferenceExpr(Expression scope, NodeList<Type> typeArguments, String identifier)
MethodReferenceExpr(TokenRange tokenRange, Expression scope, NodeList<Type> typeArguments, String identifier)
This constructor is used by the parser and is considered private.ObjectCreationExpr(Expression scope, ClassOrInterfaceType type, NodeList<Type> typeArguments, NodeList<Expression> arguments, NodeList<BodyDeclaration<?>> anonymousClassBody)
ObjectCreationExpr(TokenRange tokenRange, Expression scope, ClassOrInterfaceType type, NodeList<Type> typeArguments, NodeList<Expression> arguments, NodeList<BodyDeclaration<?>> anonymousClassBody)
This constructor is used by the parser and is considered private. -
Uses of Type in com.github.javaparser.ast.nodeTypes
Modifier and TypeInterfaceDescriptioninterface
NodeWithType<N extends Node,T extends Type>
A node with a type.Modifier and TypeMethodDescriptiondefault Type
NodeWithVariables.getCommonType()
Returns the type that is shared between all variables.default Type
NodeWithVariables.getElementType()
Returns the element type.Modifier and TypeMethodDescriptionNodeWithVariables.calculateMaximumCommonType(List<Type> types)
NodeWithVariables.getMaximumCommonType()
Returns the type that maximum shared type between all variables.NodeWithTypeArguments.getTypeArguments()
Modifier and TypeMethodDescriptiondefault Parameter
NodeWithParameters.addAndGetParameter(Type type, String name)
default FieldDeclaration
NodeWithMembers.addField(Type type, String name, Modifier.Keyword... modifiers)
Add a field to this.default FieldDeclaration
NodeWithMembers.addFieldWithInitializer(Type type, String name, Expression initializer, Modifier.Keyword... modifiers)
Add a field to this.default N
NodeWithParameters.addParameter(Type type, String name)
default FieldDeclaration
NodeWithMembers.addPrivateField(Type type, String name)
Add a private field to this.default FieldDeclaration
NodeWithMembers.addProtectedField(Type type, String name)
Add a protected field to this.default FieldDeclaration
NodeWithMembers.addPublicField(Type type, String name)
Add a public field to this.default N
NodeWithVariables.setAllTypes(Type newType)
Sets the type of all variables.default N
NodeWithTypeArguments.setTypeArguments(Type... typeArguments)
Modifier and TypeMethodDescriptionNodeWithVariables.calculateMaximumCommonType(List<Type> types)
NodeWithTypeArguments.setTypeArguments(NodeList<Type> typeArguments)
Allows you to set the generic arguments -
Uses of Type in com.github.javaparser.ast.stmt
Modifier and TypeMethodDescriptionExplicitConstructorInvocationStmt.setTypeArguments(NodeList<Type> typeArguments)
Sets the typeArgumentsModifierConstructorDescriptionExplicitConstructorInvocationStmt(NodeList<Type> typeArguments, boolean isThis, Expression expression, NodeList<Expression> arguments)
ExplicitConstructorInvocationStmt(TokenRange tokenRange, NodeList<Type> typeArguments, boolean isThis, Expression expression, NodeList<Expression> arguments)
This constructor is used by the parser and is considered private. -
Uses of Type in com.github.javaparser.ast.type
Modifier and TypeClassDescriptionclass
To indicate that a type is an array, it gets wrapped in an ArrayType for every array level it has.class
A class or an interface type.class
Represents a set of types.class
A primitive type.class
Base class for reference types.class
A type parameter.class
The union typeclass
An unknown parameter type object.class
A type called "var" waiting for Java to infer it.class
The return type of aMethodDeclaration
when it returns void.class
A wildcard type argument.Modifier and TypeMethodDescriptionType.clone()
ArrayType.getComponentType()
ArrayType.getElementType()
Finds the element type, meaning: the type without ArrayTypes around it.Type.getElementType()
Finds the element type, meaning: the type without ArrayTypes around it.Type.setAnnotations(NodeList<AnnotationExpr> annotations)
static Type
ArrayType.wrapInArrayTypes(Type type, List<ArrayType.ArrayBracketPair>... arrayBracketPairLists)
Takes lists of arrayBracketPairs, assumes the lists are ordered outer to inner and the pairs are ordered left to right.Modifier and TypeMethodDescriptionClassOrInterfaceType.getTypeArguments()
static Pair<Type,List<ArrayType.ArrayBracketPair>>
ArrayType.unwrapArrayTypes(Type type)
Takes a type that may be an ArrayType.Modifier and TypeMethodDescriptionArrayType.setComponentType(Type componentType)
static Pair<Type,List<ArrayType.ArrayBracketPair>>
ArrayType.unwrapArrayTypes(Type type)
Takes a type that may be an ArrayType.static Type
ArrayType.wrapInArrayTypes(Type type, List<ArrayType.ArrayBracketPair>... arrayBracketPairLists)
Takes lists of arrayBracketPairs, assumes the lists are ordered outer to inner and the pairs are ordered left to right.Modifier and TypeMethodDescriptionClassOrInterfaceType.setTypeArguments(NodeList<Type> typeArguments)
Sets the typeArgumentsModifierConstructorDescriptionArrayType(Type type, AnnotationExpr... annotations)
ArrayType(Type componentType, ArrayType.Origin origin, NodeList<AnnotationExpr> annotations)
ArrayType(TokenRange tokenRange, Type componentType, ArrayType.Origin origin, NodeList<AnnotationExpr> annotations)
This constructor is used by the parser and is considered private.ModifierConstructorDescriptionClassOrInterfaceType(ClassOrInterfaceType scope, SimpleName name, NodeList<Type> typeArguments)
ClassOrInterfaceType(ClassOrInterfaceType scope, SimpleName name, NodeList<Type> typeArguments, NodeList<AnnotationExpr> annotations)
ClassOrInterfaceType(TokenRange tokenRange, ClassOrInterfaceType scope, SimpleName name, NodeList<Type> typeArguments, NodeList<AnnotationExpr> annotations)
This constructor is used by the parser and is considered private. -
Uses of Type in com.github.javaparser.resolution
Modifier and TypeMethodDescription<T> T
SymbolResolver.toResolvedType(Type javaparserType, Class<T> resultClass)
For types it would find the corresponding resolved types.