Modifier and Type | Field and Description |
---|---|
static ParseStart<Type> |
ParseStart.TYPE |
Modifier and Type | Method and Description |
---|---|
static Type |
StaticJavaParser.parseType(String type)
Parses a Java type name and returns a
Type that represents it. |
Modifier and Type | Method and Description |
---|---|
ParseResult<Type> |
JavaParser.parseType(String type)
Parses a Java type name and returns a
Type that represents it. |
Modifier and Type | Method and Description |
---|---|
Type |
AnnotationMemberDeclaration.getType() |
Type |
VariableDeclarator.getType() |
Type |
MethodDeclaration.getType() |
Type |
Parameter.getType() |
Type |
ReceiverParameter.getType() |
Modifier and Type | Method and Description |
---|---|
List<Type> |
CallableDeclaration.Signature.getParameterTypes() |
Modifier and Type | Method and Description |
---|---|
FieldDeclaration |
AnnotationDeclaration.addField(Type type,
String name,
Modifier.Keyword... modifiers) |
AnnotationMemberDeclaration |
AnnotationMemberDeclaration.setType(Type type) |
VariableDeclarator |
VariableDeclarator.setType(Type type) |
MethodDeclaration |
MethodDeclaration.setType(Type type) |
Parameter |
Parameter.setType(Type type) |
ReceiverParameter |
ReceiverParameter.setType(Type type) |
Constructor and Description |
---|
AnnotationMemberDeclaration(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 a
FieldDeclaration . |
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,
String name,
Type type,
NodeList<Parameter> parameters) |
MethodDeclaration(NodeList<Modifier> modifiers,
Type type,
String name) |
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(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.
|
Parameter(Type type,
SimpleName name) |
Parameter(Type type,
String name)
Creates a new
Parameter . |
ReceiverParameter(NodeList<AnnotationExpr> annotations,
Type type,
Name name) |
ReceiverParameter(TokenRange tokenRange,
NodeList<AnnotationExpr> annotations,
Type type,
Name name)
This constructor is used by the parser and is considered private.
|
ReceiverParameter(Type type,
Name name) |
ReceiverParameter(Type type,
String name)
Creates a new
ReceiverParameter . |
VariableDeclarator(TokenRange tokenRange,
Type type,
SimpleName name,
Expression initializer)
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) |
Modifier and Type | Method and Description |
---|---|
Type |
ArrayCreationExpr.createdType()
Takes the element type and wraps it in an ArrayType for every array creation level.
|
Type |
ArrayCreationExpr.getElementType() |
Type |
CastExpr.getType() |
Type |
ClassExpr.getType() |
Type |
TypeExpr.getType() |
Modifier and Type | Method and Description |
---|---|
Optional<NodeList<Type>> |
ObjectCreationExpr.getTypeArguments() |
Optional<NodeList<Type>> |
MethodCallExpr.getTypeArguments() |
Optional<NodeList<Type>> |
FieldAccessExpr.getTypeArguments() |
Optional<NodeList<Type>> |
MethodReferenceExpr.getTypeArguments() |
Modifier and Type | Method and Description |
---|---|
ArrayCreationExpr |
ArrayCreationExpr.setElementType(Type elementType) |
CastExpr |
CastExpr.setType(Type type) |
ClassExpr |
ClassExpr.setType(Type type) |
TypeExpr |
TypeExpr.setType(Type type) |
Modifier and Type | Method and Description |
---|---|
ObjectCreationExpr |
ObjectCreationExpr.setTypeArguments(NodeList<Type> typeArguments)
Sets the typeArguments
|
MethodCallExpr |
MethodCallExpr.setTypeArguments(NodeList<Type> typeArguments)
Sets the typeArguments
|
FieldAccessExpr |
FieldAccessExpr.setTypeArguments(NodeList<Type> typeArguments)
Sets the type arguments
|
MethodReferenceExpr |
MethodReferenceExpr.setTypeArguments(NodeList<Type> typeArguments)
Sets the typeArguments
|
Constructor and Description |
---|
ArrayCreationExpr(TokenRange tokenRange,
Type elementType,
NodeList<ArrayCreationLevel> levels,
ArrayInitializerExpr initializer)
This constructor is used by the parser and is considered private.
|
ArrayCreationExpr(Type elementType) |
ArrayCreationExpr(Type elementType,
NodeList<ArrayCreationLevel> levels,
ArrayInitializerExpr initializer) |
CastExpr(TokenRange tokenRange,
Type type,
Expression expression)
This constructor is used by the parser and is considered private.
|
CastExpr(Type type,
Expression expression) |
ClassExpr(TokenRange tokenRange,
Type type)
This constructor is used by the parser and is considered private.
|
ClassExpr(Type type) |
TypeExpr(TokenRange tokenRange,
Type type)
This constructor is used by the parser and is considered private.
|
TypeExpr(Type type) |
VariableDeclarationExpr(Type type,
String variableName) |
VariableDeclarationExpr(Type type,
String variableName,
Modifier... modifiers) |
Constructor and Description |
---|
FieldAccessExpr(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.
|
Modifier and Type | Interface and Description |
---|---|
interface |
NodeWithType<N extends Node,T extends Type>
A node with a type.
|
Modifier and Type | Method and Description |
---|---|
default Type |
NodeWithVariables.getCommonType()
Returns the type that is shared between all variables.
|
default Type |
NodeWithVariables.getElementType()
Returns the element type.
|
Modifier and Type | Method and Description |
---|---|
static Optional<Type> |
NodeWithVariables.calculateMaximumCommonType(List<Type> types) |
default Optional<Type> |
NodeWithVariables.getMaximumCommonType()
Returns the type that maximum shared type between all variables.
|
Optional<NodeList<Type>> |
NodeWithTypeArguments.getTypeArguments() |
Modifier and Type | Method and Description |
---|---|
default 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 Type | Method and Description |
---|---|
static Optional<Type> |
NodeWithVariables.calculateMaximumCommonType(List<Type> types) |
N |
NodeWithTypeArguments.setTypeArguments(NodeList<Type> typeArguments)
Allows you to set the generic arguments
|
Modifier and Type | Method and Description |
---|---|
Optional<NodeList<Type>> |
ExplicitConstructorInvocationStmt.getTypeArguments() |
Modifier and Type | Method and Description |
---|---|
ExplicitConstructorInvocationStmt |
ExplicitConstructorInvocationStmt.setTypeArguments(NodeList<Type> typeArguments)
Sets the typeArguments
|
Constructor and Description |
---|
ExplicitConstructorInvocationStmt(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.
|
Modifier and Type | Class and Description |
---|---|
class |
ArrayType
To indicate that a type is an array, it gets wrapped in an ArrayType for every array level it has.
|
class |
ClassOrInterfaceType
A class or an interface type.
|
class |
IntersectionType
Represents a set of types.
|
class |
PrimitiveType
A primitive type.
|
class |
ReferenceType
Base class for reference types.
|
class |
TypeParameter
A type parameter.
|
class |
UnionType
The union type
|
class |
UnknownType
An unknown parameter type object.
|
class |
VarType
A type called "var" waiting for Java to infer it.
|
class |
VoidType
The return type of a
MethodDeclaration
when it returns void. |
class |
WildcardType
A wildcard type argument.
|
Modifier and Type | Method and Description |
---|---|
Type |
Type.clone() |
Type |
ArrayType.getComponentType() |
Type |
Type.getElementType()
Finds the element type, meaning: the type without ArrayTypes around it.
|
Type |
Type.setAnnotations(NodeList<AnnotationExpr> annotations) |
static Type |
ArrayType.wrapInArrayTypes(Type type,
List<ArrayType.ArrayBracketPair>... arrayBracketPairLists)
Takes lists of arrayBracketPairs, assumes the lists are ordered left to right and the pairs are ordered left to
right, mirroring the actual code.
|
Modifier and Type | Method and Description |
---|---|
Optional<NodeList<Type>> |
ClassOrInterfaceType.getTypeArguments() |
static Pair<Type,List<ArrayType.ArrayBracketPair>> |
ArrayType.unwrapArrayTypes(Type type)
Takes a type that may be an ArrayType.
|
Modifier and Type | Method and Description |
---|---|
ArrayType |
ArrayType.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 left to right and the pairs are ordered left to
right, mirroring the actual code.
|
Modifier and Type | Method and Description |
---|---|
ClassOrInterfaceType |
ClassOrInterfaceType.setTypeArguments(NodeList<Type> typeArguments)
Sets the typeArguments
|
Constructor and Description |
---|
ArrayType(TokenRange tokenRange,
Type componentType,
ArrayType.Origin origin,
NodeList<AnnotationExpr> annotations)
This constructor is used by the parser and is considered private.
|
ArrayType(Type type,
AnnotationExpr... annotations) |
ArrayType(Type componentType,
ArrayType.Origin origin,
NodeList<AnnotationExpr> annotations) |
Constructor and Description |
---|
ClassOrInterfaceType(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.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
SymbolResolver.toResolvedType(Type javaparserType,
Class<T> resultClass)
For types it would find the corresponding resolved types.
|
Copyright © 2007–2019. All rights reserved.