Stay organized with collections
Save and categorize content based on your preferences.
GenericDeclaration
interface GenericDeclaration : AnnotatedElement
Known Direct Subclasses
Class |
Instances of the class represent classes and interfaces in a running Java application.
|
Executable |
A shared superclass for the common functionality of Method and Constructor .
|
|
Known Indirect Subclasses
Constructor |
Constructor provides information about, and access to, a single constructor for a class.
|
Method |
A Method provides information about, and access to, a single method on a class or interface.
|
|
A common interface for all entities that declare type variables.
Summary
Public methods |
abstract Array<TypeVariable<*>!> |
Returns an array of TypeVariable objects that represent the type variables declared by the generic declaration represented by this GenericDeclaration object, in declaration order.
|
Inherited functions |
From class AnnotatedElement
T? |
getAnnotation(annotationClass: Class<T>)
Returns this element's annotation for the specified type if such an annotation is present, else null.
|
Array<Annotation!> |
getAnnotations()
Returns annotations that are present on this element. If there are no annotations present on this element, the return value is an array of length 0. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.
|
Array<T>! |
getAnnotationsByType(annotationClass: Class<T>)
Returns annotations that are associated with this element. If there are no annotations associated with this element, the return value is an array of length 0. The difference between this method and getAnnotation(java.lang.Class) is that this method detects if its argument is a repeatable annotation type (JLS 9.6), and if so, attempts to find one or more annotations of that type by "looking through" a container annotation. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.
|
T? |
getDeclaredAnnotation(annotationClass: Class<T>)
Returns this element's annotation for the specified type if such an annotation is directly present, else null. This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
|
Array<Annotation!> |
getDeclaredAnnotations()
Returns annotations that are directly present on this element. This method ignores inherited annotations. If there are no annotations directly present on this element, the return value is an array of length 0. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.
|
Array<T>! |
getDeclaredAnnotationsByType(annotationClass: Class<T>)
Returns this element's annotation(s) for the specified type if such annotations are either directly present or indirectly present. This method ignores inherited annotations. If there are no specified annotations directly or indirectly present on this element, the return value is an array of length 0. The difference between this method and getDeclaredAnnotation(java.lang.Class) is that this method detects if its argument is a repeatable annotation type (JLS 9.6), and if so, attempts to find one or more annotations of that type by "looking through" a container annotation if one is present. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.
|
Boolean |
isAnnotationPresent(annotationClass: Class<out Annotation!>)
Returns true if an annotation for the specified type is present on this element, else false. This method is designed primarily for convenient access to marker annotations.
The truth value returned by this method is equivalent to: getAnnotation(annotationClass) != null
The body of the default method is specified to be the code above.
|
|
Public methods
getTypeParameters
abstract fun getTypeParameters(): Array<TypeVariable<*>!>
Returns an array of TypeVariable
objects that represent the type variables declared by the generic declaration represented by this GenericDeclaration
object, in declaration order. Returns an array of length 0 if the underlying generic declaration declares no type variables.
Return |
Array<TypeVariable<*>!> |
an array of TypeVariable objects that represent the type variables declared by this generic declaration |
Exceptions |
java.lang.reflect.GenericSignatureFormatError |
if the generic signature of this generic declaration does not conform to the format specified in The Java™ Virtual Machine Specification |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-02-16 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{
"last_modified": "Last updated 2024-02-16 UTC.",
"state": ""
}