Langue

IAnnotatedElement.GetAnnotation(Class) Méthode

Définition

Retourne l’annotation de cet élément pour le type spécifié si une telle annotation est <em>present</em>, sinon null.

[Android.Runtime.Register("getAnnotation", "(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;", "GetGetAnnotation_Ljava_lang_Class_Handler:Java.Lang.Reflect.IAnnotatedElementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.lang.annotation.Annotation" })]
public Java.Lang.Object? GetAnnotation(Java.Lang.Class annotationClass);
[<Android.Runtime.Register("getAnnotation", "(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;", "GetGetAnnotation_Ljava_lang_Class_Handler:Java.Lang.Reflect.IAnnotatedElementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.lang.annotation.Annotation" })>]
abstract member GetAnnotation : Java.Lang.Class -> Java.Lang.Object

Paramètres

annotationClass
Class

l’objet Class correspondant au type d’annotation

Retours

annotation de cet élément pour le type d’annotation spécifié s’il est présent sur cet élément, sinon null

Attributs

Remarques

Retourne l’annotation de cet élément pour le type spécifié si une telle annotation est <em>present</em>, sinon null.

Ajouté à la version 1.5.

Java documentation pour java.lang.reflect.AnnotatedElement.getAnnotation(java.lang.Class<T>).

Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.

S’applique à