語言

Field.GetAnnotation(Class) 方法

定義

新增 1.

[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

參數

annotationType
Class

傳回

若該元素存在,則該元素對指定註解類型的註解,否則為

屬性

備註

已在1.5中新增。

Java 文件 java.lang.reflect.Field.getAnnotation(java.lang.Class<T>)。

Java 參考 java.lang.reflect.Field.getAnnotation。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於