Top Description Methods
com.github.javaparser.resolution.types

public Interface ResolvedType

Known Direct Implementers
com.github.javaparser.resolution.types.ResolvedTypeVariable, com.github.javaparser.resolution.types.ResolvedUnionType, com.github.javaparser.resolution.types.ResolvedVoidType, com.github.javaparser.resolution.types.ResolvedWildcard, com.github.javaparser.resolution.types.ResolvedArrayType, com.github.javaparser.resolution.types.ResolvedIntersectionType, com.github.javaparser.resolution.types.ResolvedLambdaConstraintType, com.github.javaparser.resolution.types.ResolvedPrimitiveType, com.github.javaparser.resolution.types.ResolvedReferenceType
Imports
com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration, java.util.HashMap, .List, .Map

A resolved type. It could be a primitive type or a reference type (enum, class, interface). In the later case it could take type typeParametersValues (other TypeUsages). It could also be a TypeVariable, like in:

class A<Bgt; { }

where B is a TypeVariable. It could also be Wildcard Type, possibly with constraints.

Author
Federico Tomassetti

Method Summary

Modifier and TypeMethod and Description
public default int
public default ResolvedArrayType
public default ResolvedLambdaConstraintType
public default ResolvedPrimitiveType
public default ResolvedReferenceType
public default ResolvedTypeParameterDeclaration
public default ResolvedTypeVariable
public default ResolvedUnionType
public default ResolvedWildcard
public String
public default boolean
isArray()

Does this type represent an array?

public boolean
isAssignableBy(ResolvedType other)

This method checks if ThisType t = new OtherType() would compile.

public default boolean
isConstraint()

Is this a lambda constraint type?

public default boolean
isNull()

Is this the null type?

public default boolean
isPrimitive()

Is this a primitive type?

public default boolean
isReference()

Is this a non primitive value?

public default boolean
isReferenceType()

Can this be seen as a ReferenceTypeUsage?

public default boolean
public default boolean
isUnionType()

Is this a union type (as the ones used in multi catch clauses)?

public default boolean
public default boolean
public default boolean
mention(List<ResolvedTypeParameterDeclaration> typeParameters)

Does this type mention at all, directly or indirectly, the given type parameters?

public default ResolvedType
replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, Map<ResolvedTypeParameterDeclaration, ResolvedType> inferredTypes)

Replace all variables referring to the given TypeParameter with the given value.

public default ResolvedType

Method Detail

arrayLevelback to summary
public default int arrayLevel()
asArrayTypeback to summary
public default ResolvedArrayType asArrayType()
asConstraintTypeback to summary
public default ResolvedLambdaConstraintType asConstraintType()
asPrimitiveback to summary
public default ResolvedPrimitiveType asPrimitive()
asReferenceTypeback to summary
public default ResolvedReferenceType asReferenceType()
asTypeParameterback to summary
public default ResolvedTypeParameterDeclaration asTypeParameter()
asTypeVariableback to summary
public default ResolvedTypeVariable asTypeVariable()
asUnionTypeback to summary
public default ResolvedUnionType asUnionType()
asWildcardback to summary
public default ResolvedWildcard asWildcard()
describeback to summary
public String describe()
isArrayback to summary
public default boolean isArray()

Does this type represent an array?

isAssignableByback to summary
public boolean isAssignableBy(ResolvedType other)

This method checks if ThisType t = new OtherType() would compile.

isConstraintback to summary
public default boolean isConstraint()

Is this a lambda constraint type?

isNullback to summary
public default boolean isNull()

Is this the null type?

isPrimitiveback to summary
public default boolean isPrimitive()

Is this a primitive type?

isReferenceback to summary
public default boolean isReference()

Is this a non primitive value?

isReferenceTypeback to summary
public default boolean isReferenceType()

Can this be seen as a ReferenceTypeUsage? In other words: is this a reference to a class, an interface or an enum?

isTypeVariableback to summary
public default boolean isTypeVariable()
isUnionTypeback to summary
public default boolean isUnionType()

Is this a union type (as the ones used in multi catch clauses)?

isVoidback to summary
public default boolean isVoid()
isWildcardback to summary
public default boolean isWildcard()
mentionback to summary
public default boolean mention(List<ResolvedTypeParameterDeclaration> typeParameters)

Does this type mention at all, directly or indirectly, the given type parameters?

replaceTypeVariablesback to summary
public default ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, Map<ResolvedTypeParameterDeclaration, ResolvedType> inferredTypes)

Replace all variables referring to the given TypeParameter with the given value. By replacing these values I could also infer some type equivalence. Those would be collected in the given map.

replaceTypeVariablesback to summary
public default ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced)

This is like (replaceTypeVariables(ResolvedTypeParameterDeclaration, ResolvedType, Map) but ignores the inferred values.