Freigeben über


IAnnotatedElement.GetAnnotation(Class) Method

Definition

Returns this element's annotation for the specified type if such an annotation is <em>present</em>, else 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

Parameters

annotationClass
Class

the Class object corresponding to the annotation type

Returns

this element's annotation for the specified annotation type if present on this element, else null

Attributes

Remarks

Returns this element's annotation for the specified type if such an annotation is <em>present</em>, else null.

Added in 1.5.

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

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to