IAnnotatedElement.GetDeclaredAnnotation(Class) Método

Definición

Devuelve la anotación de este elemento para el tipo especificado si dicha anotación es <em>directamente presente</em>, else null.

[Android.Runtime.Register("getDeclaredAnnotation", "(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;", "GetGetDeclaredAnnotation_Ljava_lang_Class_Handler:Java.Lang.Reflect.IAnnotatedElement, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.lang.annotation.Annotation" })]
public virtual Java.Lang.Object? GetDeclaredAnnotation(Java.Lang.Class annotationClass);
[<Android.Runtime.Register("getDeclaredAnnotation", "(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;", "GetGetDeclaredAnnotation_Ljava_lang_Class_Handler:Java.Lang.Reflect.IAnnotatedElement, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.lang.annotation.Annotation" })>]
abstract member GetDeclaredAnnotation : Java.Lang.Class -> Java.Lang.Object
override this.GetDeclaredAnnotation : Java.Lang.Class -> Java.Lang.Object

Parámetros

annotationClass
Class

el objeto Class correspondiente al tipo de anotación

Devoluciones

Anotación de este elemento para el tipo de anotación especificado si está directamente presente en este elemento; en caso contrario, null

Atributos

Comentarios

Devuelve la anotación de este elemento para el tipo especificado si dicha anotación es <em>directamente presente</em>, else null.

Este método omite las anotaciones heredadas. (Devuelve null si no hay anotaciones directamente presentes en este elemento).

Agregado en la versión 1.8.

Java documentación para java.lang.reflect.AnnotatedElement.getDeclaredAnnotation(java.lang.Class<T>).

Las partes de esta página son modificaciones basadas en el trabajo creado y compartido por el Android y se usan según los términos descritos en creative Creative Commons 2.5 Attribution License.

Se aplica a