Interface ResolvedTypeParameterDeclaration
-
- All Superinterfaces:
AssociableToAST
,ResolvedDeclaration
,ResolvedTypeDeclaration
- All Known Implementing Classes:
JavaParserTypeParameter
,JavassistTypeParameter
,ReflectionTypeParameter
public interface ResolvedTypeParameterDeclaration extends ResolvedTypeDeclaration
Declaration of a type parameter. For example:class A<E extends String>{}
In this case E would be a type parameter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ResolvedTypeParameterDeclaration.Bound
A Bound on a Type Parameter.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ResolvedTypeParameterDeclaration
asTypeParameter()
Return this as a TypeParameterDeclaration or throw UnsupportedOperationException.default boolean
declaredOnConstructor()
Is the type parameter been defined on a constructor?default boolean
declaredOnMethod()
Is the type parameter been defined on a method?default boolean
declaredOnType()
Is the type parameter been defined on a type?java.util.List<ResolvedTypeParameterDeclaration.Bound>
getBounds()
The bounds specified for the type parameter.default java.lang.String
getClassName()
The class(es) wrapping the type bound(s).ResolvedTypeParametrizable
getContainer()
The TypeParametrizable of the container.java.lang.String
getContainerId()
The ID of the container.java.lang.String
getContainerQualifiedName()
The qualified name of the container.default ResolvedType
getLowerBound()
Get the type used as lower bound.java.lang.String
getName()
Name of the type parameter.default java.lang.String
getPackageName()
The package name of the type bound(s).default java.lang.String
getQualifiedName()
The qualified name of the Type Parameter.default ResolvedType
getUpperBound()
Get the type used as upper bound.default boolean
hasBound()
Has the type parameter a bound?default boolean
hasLowerBound()
Has the type parameter a lower bound?default boolean
hasUpperBound()
Has the type parameter an upper bound?default boolean
isBounded()
Return true if the Type variable is boundeddefault boolean
isTypeParameter()
Is this the declaration of a type parameter?default boolean
isUnbounded()
Return true if the Type variable is unboundedResolvedReferenceType
object()
static ResolvedTypeParameterDeclaration
onType(java.lang.String name, java.lang.String classQName, java.util.List<ResolvedTypeParameterDeclaration.Bound> bounds)
Instantiate a TypeParameter defined on a Type with the given data.-
Methods inherited from interface com.github.javaparser.resolution.declarations.AssociableToAST
toAst, toAst
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedDeclaration
asEnumConstant, asField, asMethod, asParameter, asTypePattern, hasName, isEnumConstant, isField, isMethod, isParameter, isTypePattern, isVariable
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
asAnnotation, asClass, asEnum, asInterface, asRecord, asReferenceType, asType, containerType, getId, getInternalType, hasInternalType, internalTypes, isAnnotation, isAnonymousClass, isClass, isEnum, isInterface, isRecord, isReferenceType, isType
-
-
-
-
Method Detail
-
onType
static ResolvedTypeParameterDeclaration onType(java.lang.String name, java.lang.String classQName, java.util.List<ResolvedTypeParameterDeclaration.Bound> bounds)
Instantiate a TypeParameter defined on a Type with the given data.
-
getName
java.lang.String getName()
Name of the type parameter.- Specified by:
getName
in interfaceResolvedDeclaration
-
declaredOnType
default boolean declaredOnType()
Is the type parameter been defined on a type?
-
declaredOnMethod
default boolean declaredOnMethod()
Is the type parameter been defined on a method?
-
declaredOnConstructor
default boolean declaredOnConstructor()
Is the type parameter been defined on a constructor?
-
getPackageName
default java.lang.String getPackageName()
The package name of the type bound(s). This is unsupported because there is no package for a Type Parameter, only for its container.- Specified by:
getPackageName
in interfaceResolvedTypeDeclaration
-
getClassName
default java.lang.String getClassName()
The class(es) wrapping the type bound(s). This is unsupported because there is no class for a Type Parameter, only for its container.- Specified by:
getClassName
in interfaceResolvedTypeDeclaration
-
getQualifiedName
default java.lang.String getQualifiedName()
The qualified name of the Type Parameter. It is composed by the qualified name of the container followed by a dot and the name of the Type Parameter. The qualified name of a method is its qualified signature.- Specified by:
getQualifiedName
in interfaceResolvedTypeDeclaration
-
getContainerQualifiedName
java.lang.String getContainerQualifiedName()
The qualified name of the container.
-
getContainerId
java.lang.String getContainerId()
The ID of the container. See TypeContainer.getId
-
getContainer
ResolvedTypeParametrizable getContainer()
The TypeParametrizable of the container. Can be either a ReferenceTypeDeclaration or a MethodLikeDeclaration
-
getBounds
java.util.List<ResolvedTypeParameterDeclaration.Bound> getBounds()
The bounds specified for the type parameter. For example: "extends A" or "super B"
-
hasBound
default boolean hasBound()
Has the type parameter a bound?
-
hasLowerBound
default boolean hasLowerBound()
Has the type parameter a lower bound?
-
hasUpperBound
default boolean hasUpperBound()
Has the type parameter an upper bound?
-
getLowerBound
default ResolvedType getLowerBound()
Get the type used as lower bound.- Throws:
java.lang.IllegalStateException
- if there is no lower bound
-
getUpperBound
default ResolvedType getUpperBound()
Get the type used as upper bound.- Throws:
java.lang.IllegalStateException
- if there is no upper bound
-
asTypeParameter
default ResolvedTypeParameterDeclaration asTypeParameter()
Description copied from interface:ResolvedTypeDeclaration
Return this as a TypeParameterDeclaration or throw UnsupportedOperationException.- Specified by:
asTypeParameter
in interfaceResolvedTypeDeclaration
-
isTypeParameter
default boolean isTypeParameter()
Description copied from interface:ResolvedTypeDeclaration
Is this the declaration of a type parameter?- Specified by:
isTypeParameter
in interfaceResolvedTypeDeclaration
-
isBounded
default boolean isBounded()
Return true if the Type variable is bounded
-
isUnbounded
default boolean isUnbounded()
Return true if the Type variable is unbounded
-
object
ResolvedReferenceType object()
-
-