Dil

Constructor.GetAnnotation(Class) Method

Definition

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

[Android.Runtime.Register("getAnnotation", "(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "A extends java.lang.annotation.Annotation" })]
public override Java.Lang.Object? GetAnnotation(Java.Lang.Class? annotationType);
[<Android.Runtime.Register("getAnnotation", "(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "A extends java.lang.annotation.Annotation" })>]
override this.GetAnnotation : Java.Lang.Class -> Java.Lang.Object

Parameters

annotationType
Class

Returns

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

Implements

Attributes

Remarks

Returns this element's annotation for the specified type if such an annotation is present, else null. Note that any annotation returned by this method is a declaration annotation.

Added in 1.5.

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

Java reference for java.lang.reflect.Constructor.getAnnotation.

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