語言

AccessibleObject.GetDeclaredAnnotation(Class) 方法

定義

若標註 直接存在,則回傳該物件對指定類型的註解;否則,回傳 null。

[Android.Runtime.Register("getDeclaredAnnotation", "(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;", "GetGetDeclaredAnnotation_Ljava_lang_Class_Handler", ApiSince=26)]
[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", ApiSince=26)>]
[<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

參數

annotationClass
Class

對應註解類型的 Class 物件

傳回

如果直接存在,則該物件對指定註解類型的註解;否則,為零

實作

屬性

備註

新增於1.8版本。

Java 文件 java.lang.reflect.AccessibleObject.getDeclaredAnnotation(java.lang.Class<T>)

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

適用於