インタフェースjava.lang.annotation.Annotation
の使用
-
Annotationを使用しているパッケージ パッケージ 説明 java.beans Bean (JavaBeans™アーキテクチャに基づいたコンポーネント)の開発に関連したクラスが含まれています。java.lang Javaプログラミング言語の設計にあたり基本的なクラスを提供します。java.lang.annotation Javaプログラミング言語の注釈機能のライブラリ・サポートを提供します。java.lang.reflect クラスとオブジェクトに関するリフレクト情報を取得するための、クラスとインタフェースを提供します。javax.annotation.processing 注釈プロセッサを宣言し、注釈プロセッサが注釈処理ツール環境とやり取りできるようにするための機能。javax.lang.model Javaプログラミング言語をモデル化するために使用されるパッケージのクラスと階層です。javax.lang.model.element Javaプログラミング言語の要素をモデル化するために使用されるインタフェースです。javax.management Java Management Extensionsのコア・クラスを提供します。javax.swing すべてのプラットフォーム上で可能なかぎり同じように機能する「軽量」(Java共通言語)コンポーネントのセットを提供します。jdk.jfr このパッケージは、イベントを作成してFlight Recorderを制御するクラスを提供します。 -
-
java.beansでのAnnotationの使用
Annotationを実装するjava.beans内のクラス 修飾子と型 クラス 説明 interface
BeanProperty
自動的に生成されたBeanInfo
クラスのプロパティ関連情報を指定するために使用される注釈。interface
ConstructorProperties
コンストラクタの注釈。構築されたオブジェクトのgetterメソッドにこのコンストラクタのパラメータがどのように対応するかを示します。interface
JavaBean
自動生成されたBeanInfo
クラスのいくつかのクラス関連情報を指定するために使用される注釈。interface
Transient
Introspector
が注釈付きのコード要素に関連付けられたPropertyDescriptor
またはEventSetDescriptor
クラスを構築する際に、「transient」と呼ばれる属性が指定のvalue
で宣言されるべきであることを示します。 -
java.langでのAnnotationの使用
Annotationを実装するjava.lang内のクラス 修飾子と型 クラス 説明 interface
Deprecated
@Deprecated
の注釈を付けられたプログラム要素は、プログラマが使用することを薦められていないプログラム要素です。interface
FunctionalInterface
インタフェース型の宣言を、Java言語仕様に定義されている関数型インタフェースとすることを目的としていることを示すために使われる情報目的の注釈型です。interface
Override
メソッド宣言がスーパー・タイプのメソッド宣言をオーバーライドすることを示します。interface
SafeVarargs
注釈の付いたメソッドやコンストラクタの本体が自身の可変パラメータに対して安全でない可能性のある操作を実行しないことを示す、プログラマ・アサーションです。interface
SuppressWarnings
注釈を付けた要素(および注釈を付けた要素に含まれるすべてのプログラム要素)で、名前で指定されたコンパイラ警告が抑制されることを示します。Annotation型の型パラメータを持つjava.lang内のメソッド 修飾子と型 メソッド 説明 <A extends Annotation>
AClass. getAnnotation(Class<A> annotationClass)
<T extends Annotation>
TModule. getAnnotation(Class<T> annotationClass)
存在する場合は、この要素の指定された型の注釈を返し、そうでない場合はnullを返します。<A extends Annotation>
APackage. getAnnotation(Class<A> annotationClass)
<A extends Annotation>
A[]Class. getAnnotationsByType(Class<A> annotationClass)
<A extends Annotation>
A[]Package. getAnnotationsByType(Class<A> annotationClass)
<A extends Annotation>
AClass. getDeclaredAnnotation(Class<A> annotationClass)
<A extends Annotation>
APackage. getDeclaredAnnotation(Class<A> annotationClass)
<A extends Annotation>
A[]Class. getDeclaredAnnotationsByType(Class<A> annotationClass)
<A extends Annotation>
A[]Package. getDeclaredAnnotationsByType(Class<A> annotationClass)
Annotationを返すjava.lang内のメソッド 修飾子と型 メソッド 説明 Annotation[]
Class. getAnnotations()
Annotation[]
Module. getAnnotations()
この要素に存在する注釈を返します。Annotation[]
Package. getAnnotations()
<A extends Annotation>
A[]Class. getAnnotationsByType(Class<A> annotationClass)
<A extends Annotation>
A[]Package. getAnnotationsByType(Class<A> annotationClass)
Annotation[]
Class. getDeclaredAnnotations()
Annotation[]
Module. getDeclaredAnnotations()
この要素に直接存在する注釈を返します。Annotation[]
Package. getDeclaredAnnotations()
<A extends Annotation>
A[]Class. getDeclaredAnnotationsByType(Class<A> annotationClass)
<A extends Annotation>
A[]Package. getDeclaredAnnotationsByType(Class<A> annotationClass)
Annotation型の型引数を持つjava.lang内のメソッド・パラメータ 修飾子と型 メソッド 説明 boolean
Class. isAnnotationPresent(Class<? extends Annotation> annotationClass)
指定された型の注釈がこの要素に存在する場合はtrueを返し、そうでない場合はfalseを返します。boolean
Package. isAnnotationPresent(Class<? extends Annotation> annotationClass)
指定された型の注釈がこの要素に存在する場合はtrueを返し、そうでない場合はfalseを返します。 -
java.lang.annotationでのAnnotationの使用
Annotationを実装するjava.lang.annotation内のクラス 修飾子と型 クラス 説明 interface
Documented
注釈@Documented
が注釈型Aの宣言に存在する場合、要素の@A
注釈は要素のパブリック契約の一部とみなされます。interface
Inherited
注釈型が自動的に継承されることを示します。interface
Native
定数値を定義するフィールドがネイティブ・コードから参照される可能性があることを示します。interface
Repeatable
注釈型java.lang.annotation.Repeatable
は、宣言に(メタ)注釈を付ける注釈型が繰返し可能であることを示すために使用されます。interface
Retention
注釈付きの型を持つ注釈を保持する期間を示します。interface
Target
注釈型が適用可能なコンテキストを示します。Annotation型の引数を持つ型を返すjava.lang.annotation内のメソッド 修飾子と型 メソッド 説明 Class<? extends Annotation>
Annotation. annotationType()
この注釈の注釈型を返します。Class<? extends Annotation>
IncompleteAnnotationException. annotationType()
見つからない要素を持つ注釈型に対応するClassオブジェクトを返します。Class<? extends Annotation>
value()
繰返し可能な注釈型用の包含する注釈型を示します。Annotation型の型引数を持つjava.lang.annotation内のコンストラクタ・パラメータ コンストラクタ 説明 IncompleteAnnotationException(Class<? extends Annotation> annotationType, String elementName)
IncompleteAnnotationExceptionを構築して、名前付き要素が指定された注釈型から見つからないことを示します。 -
java.lang.reflectでのAnnotationの使用
Annotation型の型パラメータを持つjava.lang.reflect内のメソッド 修飾子と型 メソッド 説明 <T extends Annotation>
TAccessibleObject. getAnnotation(Class<T> annotationClass)
<T extends Annotation>
TAnnotatedElement. getAnnotation(Class<T> annotationClass)
存在する場合は、この要素の指定された型の注釈を返し、そうでない場合はnullを返します。<T extends Annotation>
TConstructor. getAnnotation(Class<T> annotationClass)
存在する場合は、この要素の指定された型の注釈を返し、そうでない場合はnullを返します。<T extends Annotation>
TExecutable. getAnnotation(Class<T> annotationClass)
存在する場合は、この要素の指定された型の注釈を返し、そうでない場合はnullを返します。<T extends Annotation>
TField. getAnnotation(Class<T> annotationClass)
<T extends Annotation>
TMethod. getAnnotation(Class<T> annotationClass)
存在する場合は、この要素の指定された型の注釈を返し、そうでない場合はnullを返します。<T extends Annotation>
TParameter. getAnnotation(Class<T> annotationClass)
存在する場合は、この要素の指定された型の注釈を返し、そうでない場合はnullを返します。<T extends Annotation>
T[]AccessibleObject. getAnnotationsByType(Class<T> annotationClass)
default <T extends Annotation>
T[]AnnotatedElement. getAnnotationsByType(Class<T> annotationClass)
この要素に関連付けられている注釈を返します。<T extends Annotation>
T[]Executable. getAnnotationsByType(Class<T> annotationClass)
この要素に関連付けられている注釈を返します。<T extends Annotation>
T[]Field. getAnnotationsByType(Class<T> annotationClass)
この要素に関連付けられている注釈を返します。<T extends Annotation>
T[]Parameter. getAnnotationsByType(Class<T> annotationClass)
この要素に関連付けられている注釈を返します。<T extends Annotation>
TAccessibleObject. getDeclaredAnnotation(Class<T> annotationClass)
default <T extends Annotation>
TAnnotatedElement. getDeclaredAnnotation(Class<T> annotationClass)
直接存在する場合は、この要素の指定された型の注釈を返し、そうでない場合はnullを返します。<T extends Annotation>
TParameter. getDeclaredAnnotation(Class<T> annotationClass)
<T extends Annotation>
T[]AccessibleObject. getDeclaredAnnotationsByType(Class<T> annotationClass)
default <T extends Annotation>
T[]AnnotatedElement. getDeclaredAnnotationsByType(Class<T> annotationClass)
直接存在するか間接的に存在する場合は、この要素の指定された型の注釈を返します。<T extends Annotation>
T[]Parameter. getDeclaredAnnotationsByType(Class<T> annotationClass)
Annotationを返すjava.lang.reflect内のメソッド 修飾子と型 メソッド 説明 Annotation[]
AccessibleObject. getAnnotations()
Annotation[]
AnnotatedElement. getAnnotations()
この要素に存在する注釈を返します。<T extends Annotation>
T[]AccessibleObject. getAnnotationsByType(Class<T> annotationClass)
default <T extends Annotation>
T[]AnnotatedElement. getAnnotationsByType(Class<T> annotationClass)
この要素に関連付けられている注釈を返します。<T extends Annotation>
T[]Executable. getAnnotationsByType(Class<T> annotationClass)
この要素に関連付けられている注釈を返します。<T extends Annotation>
T[]Field. getAnnotationsByType(Class<T> annotationClass)
この要素に関連付けられている注釈を返します。<T extends Annotation>
T[]Parameter. getAnnotationsByType(Class<T> annotationClass)
この要素に関連付けられている注釈を返します。Annotation[]
AccessibleObject. getDeclaredAnnotations()
Annotation[]
AnnotatedElement. getDeclaredAnnotations()
この要素に直接存在する注釈を返します。Annotation[]
Constructor. getDeclaredAnnotations()
この要素に直接存在する注釈を返します。Annotation[]
Method. getDeclaredAnnotations()
この要素に直接存在する注釈を返します。<T extends Annotation>
T[]AccessibleObject. getDeclaredAnnotationsByType(Class<T> annotationClass)
default <T extends Annotation>
T[]AnnotatedElement. getDeclaredAnnotationsByType(Class<T> annotationClass)
直接存在するか間接的に存在する場合は、この要素の指定された型の注釈を返します。<T extends Annotation>
T[]Parameter. getDeclaredAnnotationsByType(Class<T> annotationClass)
Annotation[][]
Constructor. getParameterAnnotations()
このオブジェクトによって表されるExecutable
の仮パラメータの注釈を表すAnnotation
の配列の配列を、宣言順に返します。abstract Annotation[][]
Executable. getParameterAnnotations()
このオブジェクトによって表されるExecutable
の仮パラメータの注釈を表すAnnotation
の配列の配列を、宣言順に返します。Annotation[][]
Method. getParameterAnnotations()
このオブジェクトによって表されるExecutable
の仮パラメータの注釈を表すAnnotation
の配列の配列を、宣言順に返します。Annotation型の型引数を持つjava.lang.reflect内のメソッド・パラメータ 修飾子と型 メソッド 説明 boolean
AccessibleObject. isAnnotationPresent(Class<? extends Annotation> annotationClass)
指定された型の注釈がこの要素に存在する場合はtrueを返し、そうでない場合はfalseを返します。default boolean
AnnotatedElement. isAnnotationPresent(Class<? extends Annotation> annotationClass)
指定された型の注釈がこの要素に存在する場合はtrueを返し、そうでない場合はfalseを返します。 -
javax.annotation.processingでのAnnotationの使用
Annotationを実装するjavax.annotation.processing内のクラス 修飾子と型 クラス 説明 interface
Generated
Generated注釈は、生成されたソース・コードにマークを付けるために使用されます。interface
SupportedAnnotationTypes
ある注釈プロセッサがサポートする注釈型を示すのに使用される注釈。interface
SupportedOptions
ある注釈プロセッサがサポートするオプションを示すのに使用される注釈。interface
SupportedSourceVersion
ある注釈プロセッサがサポートする最新ソース・バージョンを示すのに使用される注釈。Annotation型の型引数を持つjavax.annotation.processing内のメソッド・パラメータ 修飾子と型 メソッド 説明 Set<? extends Element>
RoundEnvironment. getElementsAnnotatedWith(Class<? extends Annotation> a)
指定された注釈型を使って注釈を付けられた要素を返します。default Set<? extends Element>
RoundEnvironment. getElementsAnnotatedWithAny(Set<Class<? extends Annotation>> annotations)
指定された注釈型の1つ以上で注釈が付けられた要素を返します。 -
javax.lang.modelでのAnnotationの使用
Annotation型の型パラメータを持つjavax.lang.model内のメソッド 修飾子と型 メソッド 説明 <A extends Annotation>
AAnnotatedConstruct. getAnnotation(Class<A> annotationType)
存在する場合は、この構造の指定された型の注釈を返し、そうでない場合はnull
を返します。<A extends Annotation>
A[]AnnotatedConstruct. getAnnotationsByType(Class<A> annotationType)
この構造に関連付けられている注釈を返します。Annotationを返すjavax.lang.model内のメソッド 修飾子と型 メソッド 説明 <A extends Annotation>
A[]AnnotatedConstruct. getAnnotationsByType(Class<A> annotationType)
この構造に関連付けられている注釈を返します。 -
javax.lang.model.elementでのAnnotationの使用
Annotation型の型パラメータを持つjavax.lang.model.element内のメソッド 修飾子と型 メソッド 説明 <A extends Annotation>
AElement. getAnnotation(Class<A> annotationType)
存在する場合は、この構造の指定された型の注釈を返し、そうでない場合はnull
を返します。 -
javax.managementでのAnnotationの使用
Annotationを実装するjavax.management内のクラス 修飾子と型 クラス 説明 interface
ConstructorParameters
コンストラクタの注釈。構築されたオブジェクトのgetterメソッドにこのコンストラクタのパラメータがどのように対応するかを示します。interface
DescriptorKey
注釈要素とDescriptor
内のフィールドとの関係を記述するメタ注釈です。interface
MXBean
インタフェースに対して、MXBeanインタフェースである、またはMXBeanインタフェースではないというマークを明示的に付けるための注釈です。 -
javax.swingでのAnnotationの使用
Annotationを実装しているjavax.swingのクラス 修飾子と型 クラス 説明 interface
SwingContainer
自動的に生成されたBeanInfo
クラスのswing関連情報を指定するために使用される注釈。 -
jdk.jfrでのAnnotationの使用
Annotationを実装しているjdk.jfrのクラス 修飾子と型 クラス 説明 interface
BooleanFlag
イベント・フィールド注釈で、値がブール・フラグ、true
またはfalse
の値であることを指定しますinterface
Category
イベント・タイプをカテゴリに関連付けるイベント注釈(判読可能なパス形式)。interface
ContentType
メタ注釈は、注釈がコンテンツ・タイプ(タイム・スパン、頻度など)を表すことを示します。interface
DataAmount
イベント・フィールド注釈で、値がデータ(たとえば、バイト)の量を表すことを指定します。interface
Description
文または2つを使用して要素を記述する注釈。interface
Enabled
イベント注釈は、デフォルトでイベントを有効にするかどうかを決定します。interface
Experimental
要素が試験的なものであり、予告なしに変更される可能性があることを指定する注釈。interface
Frequency
イベント・フィールド注釈で、値がHzで測定される頻度であることを指定します。interface
Label
要素(たとえば、"Maximum Throughput"
)に判読可能な名前を設定する注釈。interface
MemoryAddress
イベント・フィールド注釈は、値がメモリー・アドレスであることを示します。interface
MetadataDefinition
新しいタイプのイベント・メタデータを定義するためのメタ注釈。interface
Name
要素(たとえば、イベントのデフォルト・パッケージが適切でない場合などです。)のデフォルト名をオーバーライドする注釈。interface
Percentage
分数(通常は0.0
と1.0
の間)で使用するイベント・フィールド注釈で、値がパーセントであることを指定します。interface
Period
イベント注釈で、定期イベントのデフォルト設定値を指定します。interface
Registered
プログラムによるイベント登録のためのイベント注釈。interface
Relational
注釈で使用される、リレーショナル注釈のメタ注釈。interface
SettingDefinition
イベント・クラスのメソッドをイベントの除外に使用する必要があることを指定する注釈。interface
StackTrace
イベント注釈。デフォルトでイベントにスタック・トレースがあるかどうかを判別します。interface
Threshold
イベント注釈で、イベントが(たとえば、"20 ms"
)に記録されないデフォルト期間を指定します。interface
Timespan
イベント・フィールド注釈は、値が期間であることを指定します。interface
Timestamp
イベント・フィールド注釈は、値が特定の時点であることを示します。interface
TransitionFrom
イベント・フィールド注釈で、イベントがスレッドから遷移することを指定します。interface
TransitionTo
イベント・フィールド注釈では、イベントがスレッドにすぐに遷移することを指定します。interface
Unsigned
イベント・フィールド注釈は、値が符号なしデータ型であることを示します。型Annotationの型パラメータを持つjdk.jfrのメソッド 修飾子と型 メソッド 説明 <A extends Annotation>
AEventType. getAnnotation(Class<A> annotationClass)
同じ名前の注釈要素が直接存在する場合は、指定された型の最初の注釈を返します。そうでない場合はnull
を返します。<A extends Annotation>
ASettingDescriptor. getAnnotation(Class<A> annotationType)
同じ名前の注釈要素が使用可能な場合は、指定された型の最初の注釈を返します。それ以外の場合はnull
を返します。<A extends Annotation>
AValueDescriptor. getAnnotation(Class<A> annotationType)
この値記述子(null
)に同じ名前の注釈要素が直接存在する場合は、指定された型の最初の注釈を返します。型Annotationの型引数を持つjdk.jfrのメソッド・パラメータ 修飾子と型 メソッド 説明 <A> A
AnnotationElement. getAnnotation(Class<? extends Annotation> annotationType)
同じ名前のAnnotationElement
が存在する場合は、指定された型の最初の注釈を戻し、それ以外の場合はnull
を戻します。型Annotationの型引数を持つjdk.jfrのコンストラクタ・パラメータ コンストラクタ 説明 AnnotationElement(Class<? extends Annotation> annotationType)
動的に定義されるイベントに使用する注釈要素を作成します。AnnotationElement(Class<? extends Annotation> annotationType, Object value)
動的に定義されるイベントに使用する注釈要素を作成します。AnnotationElement(Class<? extends Annotation> annotationType, Map<String,Object> values)
動的に定義されるイベントに使用する注釈要素を作成します。
-