public abstract class AnnotatedElementUtils extends ObjectSE
AnnotatedElements
SE でアノテーション、メタアノテーション、反復可能なアノテーションを見つけるための一般的なユーティリティメソッド。AnnotatedElementUtils
は、アノテーション属性オーバーライドをサポートする Spring のメタアノテーションプログラミングモデルのパブリック API を定義します。アノテーション属性のオーバーライドをサポートする必要がない場合は、代わりに AnnotationUtils
の使用を検討してください。
このクラスの機能は、JDK のイントロスペクション機能自体では提供されないことに注意してください。
合成アノテーションの 属性オーバーライドを使用したメタアノテーションのサポートは、getMergedAnnotationAttributes()
、getMergedAnnotation()
、getAllMergedAnnotations()
、getMergedRepeatableAnnotations()
、findMergedAnnotationAttributes()
、findMergedAnnotation()
、findAllMergedAnnotations()
、findMergedRepeatableAnnotations()
メソッドのすべてのバリアントによって提供されます。
このクラスのメソッドで使用される検索アルゴリズムは、検索または取得のセマンティクスに従います。使用される検索アルゴリズムの詳細については、各メソッドの javadoc を参照してください。
セマンティクスを取得するは、AnnotatedElement
に存在する(つまり、ローカルで宣言されているか継承SEされている)アノテーション、または AnnotatedElement
の上のアノテーション階層内で宣言されているアノテーションの検索に限定されています。
セマンティクスを見つけるはより包括的であり、get セマンティクスと次のサポートを提供します。
@Inherited
のサポート get セマンティクスに続くメソッドは、継承されたアノテーションよりもローカルで宣言されたアノテーション(カスタム構成アノテーションを含む)が優先されることを除いて、Java の @Inherited
SE アノテーションの規約に従います。対照的に、find セマンティクスに従うメソッドは、@Inherited
の存在を完全に無視します。これは、find 検索アルゴリズムが手動で型とメソッドの階層をトラバースし、@Inherited
を必要とせずに暗黙的にアノテーションの継承をサポートするためです。
AliasFor
, AnnotationAttributes
, AnnotationUtils
, BridgeMethodResolver
コンストラクターと説明 |
---|
AnnotatedElementUtils() |
修飾子と型 | メソッドと説明 |
---|---|
static <A extends AnnotationSE> | findAllMergedAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType) 指定された element の上のアノテーション階層内で、指定された annotationType のすべてのアノテーションを検索します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType のアノテーションに合成します。 |
static SetSE<AnnotationSE> | findAllMergedAnnotations(AnnotatedElementSE element, SetSE<ClassSE<? extends AnnotationSE>> annotationTypes) 指定された element の上のアノテーション階層内で、指定された annotationTypes のすべてのアノテーションを検索します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を対応する annotationType のアノテーションに合成します。 |
static <A extends AnnotationSE> | findMergedAnnotation(AnnotatedElementSE element, ClassSE<A> annotationType) 指定された element の上のアノテーション階層内で指定された annotationType の最初のアノテーションを見つけ、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションからの一致する属性とマージし、結果を指定された annotationType のアノテーションに合成します。 |
static AnnotationAttributes | findMergedAnnotationAttributes(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType, boolean classValuesAsString, boolean nestedAnnotationsAsMap) 指定された element の上のアノテーション階層内で指定された annotationType の最初のアノテーションを検索し、そのアノテーションの属性を、アノテーション階層の下位レベルのアノテーションの一致する属性とマージします。 |
static AnnotationAttributes | findMergedAnnotationAttributes(AnnotatedElementSE element, StringSE annotationName, boolean classValuesAsString, boolean nestedAnnotationsAsMap) 指定された element の上のアノテーション階層内で指定された annotationName の最初のアノテーションを検索し、そのアノテーションの属性を、アノテーション階層の下位レベルのアノテーションの一致する属性とマージします。 |
static <A extends AnnotationSE> | findMergedRepeatableAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType) 指定された element の上のアノテーション階層内で、指定された annotationType のすべての繰り返し可能なアノテーションを検索します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType のアノテーションに合成します。 |
static <A extends AnnotationSE> | findMergedRepeatableAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType, ClassSE<? extends AnnotationSE> containerType) 指定された element の上のアノテーション階層内で、指定された annotationType のすべての繰り返し可能なアノテーションを検索します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType のアノテーションに合成します。 |
static AnnotatedElementSE | forAnnotations(AnnotationSE... annotations) 通常は AnnotatedElementUtils の他のメソッドで使用するために、指定されたアノテーションに適応した AnnotatedElement SE を構築します。 |
static MultiValueMap<StringSE, ObjectSE> | getAllAnnotationAttributes(AnnotatedElementSE element, StringSE annotationName) 指定された AnnotatedElement SE の上のアノテーション階層にある指定された annotationName のすべてのアノテーションのアノテーション属性を取得し、結果を MultiValueMap に保存します。 |
static MultiValueMap<StringSE, ObjectSE> | getAllAnnotationAttributes(AnnotatedElementSE element, StringSE annotationName, boolean classValuesAsString, boolean nestedAnnotationsAsMap) 指定された AnnotatedElement SE の上のアノテーション階層にある指定された annotationName のすべてのアノテーションのアノテーション属性を取得し、結果を MultiValueMap に保存します。 |
static <A extends AnnotationSE> | getAllMergedAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType) 指定された element の上のアノテーション階層内で、指定された annotationType のすべてのアノテーションを取得します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType のアノテーションに合成します。 |
static SetSE<AnnotationSE> | getAllMergedAnnotations(AnnotatedElementSE element, SetSE<ClassSE<? extends AnnotationSE>> annotationTypes) 指定された element の上のアノテーション階層内で、指定された annotationTypes のすべてのアノテーションを取得します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を対応する annotationType のアノテーションに合成します。 |
static <A extends AnnotationSE> | getMergedAnnotation(AnnotatedElementSE element, ClassSE<A> annotationType) 指定された element の上のアノテーション階層内の指定された annotationType の最初のアノテーションを取得し、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType のアノテーションに合成します。 |
static AnnotationAttributes | getMergedAnnotationAttributes(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType) 指定された element の上のアノテーション階層内で指定された annotationType の最初のアノテーションを取得し、そのアノテーションの属性を、アノテーション階層の下位レベルのアノテーションの一致する属性とマージします。 |
static AnnotationAttributes | getMergedAnnotationAttributes(AnnotatedElementSE element, StringSE annotationName) 指定された element の上のアノテーション階層内で指定された annotationName の最初のアノテーションを取得し、そのアノテーションの属性を、アノテーション階層の下位レベルのアノテーションの一致する属性とマージします。 |
static AnnotationAttributes | getMergedAnnotationAttributes(AnnotatedElementSE element, StringSE annotationName, boolean classValuesAsString, boolean nestedAnnotationsAsMap) 指定された element の上のアノテーション階層内で指定された annotationName の最初のアノテーションを取得し、そのアノテーションの属性を、アノテーション階層の下位レベルのアノテーションの一致する属性とマージします。 |
static <A extends AnnotationSE> | getMergedRepeatableAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType) 指定された element の上のアノテーション階層内で、指定された annotationType のすべての繰り返し可能なアノテーションを取得します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType のアノテーションに合成します。 |
static <A extends AnnotationSE> | getMergedRepeatableAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType, ClassSE<? extends AnnotationSE> containerType) 指定された element の上のアノテーション階層内で、指定された annotationType のすべての繰り返し可能なアノテーションを取得します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType のアノテーションに合成します。 |
static SetSE<StringSE> | getMetaAnnotationTypes(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType) 指定された AnnotatedElement SE の(指定された annotationType の)アノテーションに存在するすべてのメタアノテーション型の完全修飾クラス名を取得します。 |
static SetSE<StringSE> | getMetaAnnotationTypes(AnnotatedElementSE element, StringSE annotationName) 指定された AnnotatedElement SE の(指定された annotationName の)アノテーションに存在するすべてのメタアノテーション型の完全修飾クラス名を取得します。 |
static boolean | hasAnnotation(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType) 指定された annotationType のアノテーションが、提供された AnnotatedElement SE で、指定された要素の上のアノテーション階層内で使用可能かどうかを判別します。 |
static boolean | hasMetaAnnotationTypes(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType) 提供された AnnotatedElement SE が、指定された annotationType のアノテーションでメタアノテーションが付けられた合成アノテーションでアノテーションが付けられているかどうかを判別します。 |
static boolean | hasMetaAnnotationTypes(AnnotatedElementSE element, StringSE annotationName) 提供された AnnotatedElement SE が、指定された annotationName のアノテーションでメタアノテーションが付けられた合成アノテーションでアノテーションが付けられているかどうかを判別します。 |
static boolean | isAnnotated(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType) 指定された annotationType のアノテーションが、指定された AnnotatedElement SE に存在するか、指定された要素の上のアノテーション階層内に存在するかを判別します。 |
static boolean | isAnnotated(AnnotatedElementSE element, StringSE annotationName) 指定された annotationName のアノテーションが、指定された AnnotatedElement SE に存在するか、指定された要素の上のアノテーション階層内に存在するかを判別します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public static AnnotatedElementSE forAnnotations(AnnotationSE... annotations)
AnnotatedElementUtils
の他のメソッドで使用するために、指定されたアノテーションに適応した AnnotatedElement
SE を構築します。annotations
- AnnotatedElement
を通じて公開するアノテーション public static SetSE<StringSE> getMetaAnnotationTypes(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType)
AnnotatedElement
SE の(指定された annotationType
の)アノテーションに存在するすべてのメタアノテーション型の完全修飾クラス名を取得します。このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 annotationType
- メタアノテーションを検索するアノテーション型 null
getMetaAnnotationTypes(AnnotatedElement, String)
, hasMetaAnnotationTypes(java.lang.reflect.AnnotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation>)
public static SetSE<StringSE> getMetaAnnotationTypes(AnnotatedElementSE element, StringSE annotationName)
AnnotatedElement
SE の(指定された annotationName
の)アノテーションに存在するすべてのメタアノテーション型の完全修飾クラス名を取得します。このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 annotationName
- メタアノテーションを検索するアノテーション型の完全修飾クラス名 getMetaAnnotationTypes(AnnotatedElement, Class)
, hasMetaAnnotationTypes(java.lang.reflect.AnnotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation>)
public static boolean hasMetaAnnotationTypes(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType)
AnnotatedElement
SE が、指定された annotationType
のアノテーションでメタアノテーションが付けられた合成アノテーションでアノテーションが付けられているかどうかを判別します。このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 annotationType
- 検索するメタアノテーション型 true
(一致するメタアノテーションが存在する場合)getMetaAnnotationTypes(java.lang.reflect.AnnotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation>)
public static boolean hasMetaAnnotationTypes(AnnotatedElementSE element, StringSE annotationName)
AnnotatedElement
SE が、指定された annotationName
のアノテーションでメタアノテーションが付けられた合成アノテーションでアノテーションが付けられているかどうかを判別します。このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 annotationName
- 検索するメタアノテーション型の完全修飾クラス名 true
(一致するメタアノテーションが存在する場合)getMetaAnnotationTypes(java.lang.reflect.AnnotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation>)
public static boolean isAnnotated(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType)
annotationType
のアノテーションが、指定された AnnotatedElement
SE に存在するか、指定された要素の上のアノテーション階層内に存在するかを判別します。 このメソッドが true
を返す場合、getMergedAnnotationAttributes(java.lang.reflect.AnnotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation>)
は null 以外の値を返します。
このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 annotationType
- 検索するアノテーション型 true
hasAnnotation(AnnotatedElement, Class)
public static boolean isAnnotated(AnnotatedElementSE element, StringSE annotationName)
annotationName
のアノテーションが、指定された AnnotatedElement
SE に存在するか、指定された要素の上のアノテーション階層内に存在するかを判別します。 このメソッドが true
を返す場合、getMergedAnnotationAttributes(java.lang.reflect.AnnotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation>)
は null 以外の値を返します。
このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 annotationName
- 検索するアノテーション型の完全修飾クラス名 true
@Nullable public static AnnotationAttributes getMergedAnnotationAttributes(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType)
element
の上のアノテーション階層内で指定された annotationType
の最初のアノテーションを取得し、そのアノテーションの属性を、アノテーション階層の下位レベルのアノテーションの一致する属性とマージします。@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは getMergedAnnotationAttributes(AnnotatedElement, String)
に委譲します。
element
- アノテーション付き要素 annotationType
- 検索するアノテーション型 AnnotationAttributes
、または見つからない場合は null
getMergedAnnotationAttributes(AnnotatedElement, String, boolean, boolean)
, findMergedAnnotationAttributes(AnnotatedElement, String, boolean, boolean)
, getMergedAnnotation(AnnotatedElement, Class)
, findMergedAnnotation(AnnotatedElement, Class)
@Nullable public static AnnotationAttributes getMergedAnnotationAttributes(AnnotatedElementSE element, StringSE annotationName)
element
の上のアノテーション階層内で指定された annotationName
の最初のアノテーションを取得し、そのアノテーションの属性を、アノテーション階層の下位レベルのアノテーションの一致する属性とマージします。@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは getMergedAnnotationAttributes(AnnotatedElement, String, boolean, boolean)
に委譲し、classValuesAsString
および nestedAnnotationsAsMap
に false
を提供します。
element
- アノテーション付き要素 annotationName
- 検索するアノテーション型の完全修飾クラス名 AnnotationAttributes
、または見つからない場合は null
getMergedAnnotationAttributes(AnnotatedElement, String, boolean, boolean)
, findMergedAnnotationAttributes(AnnotatedElement, String, boolean, boolean)
, findMergedAnnotation(AnnotatedElement, Class)
, getAllAnnotationAttributes(AnnotatedElement, String)
@Nullable public static AnnotationAttributes getMergedAnnotationAttributes(AnnotatedElementSE element, StringSE annotationName, boolean classValuesAsString, boolean nestedAnnotationsAsMap)
element
の上のアノテーション階層内で指定された annotationName
の最初のアノテーションを取得し、そのアノテーションの属性を、アノテーション階層の下位レベルのアノテーションの一致する属性とマージします。 アノテーション階層の下位レベルの属性は、上位レベルの同じ名前の属性をオーバーライドし、@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされます。
getAllAnnotationAttributes(java.lang.reflect.AnnotatedElement, java.lang.String)
とは異なり、このメソッドで使用される検索アルゴリズムは、指定された annotationName
の最初のアノテーションが見つかると、アノテーション階層の検索を停止します。結果として、指定された annotationName
の追加のアノテーションは無視されます。
このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 annotationName
- 検索するアノテーション型の完全修飾クラス名 classValuesAsString
- クラス参照を文字列に変換するか、クラス参照として保持するか nestedAnnotationsAsMap
- ネストされた Annotation インスタンスを AnnotationAttributes
マップに変換するか、Annotation インスタンスとして保持するか AnnotationAttributes
、または見つからない場合は null
findMergedAnnotation(AnnotatedElement, Class)
, findMergedAnnotationAttributes(AnnotatedElement, String, boolean, boolean)
, getAllAnnotationAttributes(AnnotatedElement, String, boolean, boolean)
@Nullable public static <A extends AnnotationSE> A getMergedAnnotation(AnnotatedElementSE element, ClassSE<A> annotationType)
element
の上のアノテーション階層内の指定された annotationType
の最初のアノテーションを取得し、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType
のアノテーションに合成します。@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは getMergedAnnotationAttributes(AnnotatedElement, Class)
および AnnotationUtils.synthesizeAnnotation(Map, Class, AnnotatedElement)
に委譲します。
element
- アノテーション付き要素 annotationType
- 検索するアノテーション型 Annotation
、見つからない場合は null
getMergedAnnotationAttributes(AnnotatedElement, Class)
, findMergedAnnotation(AnnotatedElement, Class)
, AnnotationUtils.synthesizeAnnotation(Map, Class, AnnotatedElement)
public static <A extends AnnotationSE> SetSE<A> getAllMergedAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType)
element
の上のアノテーション階層内で、指定された annotationType
のすべてのアノテーションを取得します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType
のアノテーションに合成します。@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 (非 null
)annotationType
- 検索するアノテーション型 (非 null
)Annotations
のセットが見つかりました。見つからなかった場合は空のセット getMergedAnnotation(AnnotatedElement, Class)
, getAllAnnotationAttributes(AnnotatedElement, String)
, findAllMergedAnnotations(AnnotatedElement, Class)
public static SetSE<AnnotationSE> getAllMergedAnnotations(AnnotatedElementSE element, SetSE<ClassSE<? extends AnnotationSE>> annotationTypes)
element
の上のアノテーション階層内で、指定された annotationTypes
のすべてのアノテーションを取得します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を対応する annotationType
のアノテーションに合成します。@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 (非 null
)annotationTypes
- 検索するアノテーション型 Annotations
のセットが見つかりました。見つからなかった場合は空のセット getAllMergedAnnotations(AnnotatedElement, Class)
public static <A extends AnnotationSE> SetSE<A> getMergedRepeatableAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType)
element
の上のアノテーション階層内で、指定された annotationType
のすべての繰り返し可能なアノテーションを取得します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType
のアノテーションに合成します。 繰り返し可能なアノテーションを保持するコンテナー型は、Repeatable
SE を介して検索されます。
@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 (非 null
)annotationType
- 検索するアノテーション型 (非 null
)Annotations
のセット、または何も見つからなかった場合は空のセット IllegalArgumentExceptionSE
- element
または annotationType
が null
である場合、またはコンテナー型を解決できない場合 getMergedAnnotation(AnnotatedElement, Class)
, getAllMergedAnnotations(AnnotatedElement, Class)
, getMergedRepeatableAnnotations(AnnotatedElement, Class, Class)
public static <A extends AnnotationSE> SetSE<A> getMergedRepeatableAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType, @Nullable ClassSE<? extends AnnotationSE> containerType)
element
の上のアノテーション階層内で、指定された annotationType
のすべての繰り返し可能なアノテーションを取得します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType
のアノテーションに合成します。@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 (非 null
)annotationType
- 検索するアノテーション型 (非 null
)containerType
- アノテーションを保持するコンテナーの型。コンテナー型を Repeatable
SE でルックアップする必要がある場合は、null
の場合があります Annotations
のセット、または何も見つからなかった場合は空のセット IllegalArgumentExceptionSE
- element
または annotationType
が null
である場合、またはコンテナー型を解決できない場合 AnnotationConfigurationException
- 指定された containerType
が指定された annotationType
の有効なコンテナーアノテーションでない場合 getMergedAnnotation(AnnotatedElement, Class)
, getAllMergedAnnotations(AnnotatedElement, Class)
@Nullable public static MultiValueMap<StringSE,ObjectSE> getAllAnnotationAttributes(AnnotatedElementSE element, StringSE annotationName)
AnnotatedElement
SE の上のアノテーション階層にある指定された annotationName
のすべてのアノテーションのアノテーション属性を取得し、結果を MultiValueMap
に保存します。 メモ: getMergedAnnotationAttributes(AnnotatedElement, String)
とは異なり、このメソッドは属性のオーバーライドをサポートしていません。
このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 annotationName
- 検索するアノテーション型の完全修飾クラス名 MultiValueMap
、見つからない場合は null
getAllAnnotationAttributes(AnnotatedElement, String, boolean, boolean)
@Nullable public static MultiValueMap<StringSE,ObjectSE> getAllAnnotationAttributes(AnnotatedElementSE element, StringSE annotationName, boolean classValuesAsString, boolean nestedAnnotationsAsMap)
AnnotatedElement
SE の上のアノテーション階層にある指定された annotationName
のすべてのアノテーションのアノテーション属性を取得し、結果を MultiValueMap
に保存します。 メモ: getMergedAnnotationAttributes(AnnotatedElement, String)
とは異なり、このメソッドは属性のオーバーライドをサポートしていません。
このメソッドは、クラスレベルの javadoc で説明されている get セマンティクスに従います。
element
- アノテーション付き要素 annotationName
- 検索するアノテーション型の完全修飾クラス名 classValuesAsString
- クラス参照を文字列に変換するか、クラス参照として保持するか nestedAnnotationsAsMap
- ネストされた Annotation インスタンスを AnnotationAttributes
マップに変換するか、Annotation インスタンスとして保持するか MultiValueMap
、見つからない場合は null
public static boolean hasAnnotation(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType)
annotationType
のアノテーションが、提供された AnnotatedElement
SE で、指定された要素の上のアノテーション階層内で使用可能かどうかを判別します。 このメソッドが true
を返す場合、findMergedAnnotationAttributes(java.lang.reflect.AnnotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation>, boolean, boolean)
は null 以外の値を返します。
このメソッドは、クラスレベルの javadoc で説明されている検索セマンティクスに従います。
element
- アノテーション付き要素 annotationType
- 検索するアノテーション型 true
isAnnotated(AnnotatedElement, Class)
@Nullable public static AnnotationAttributes findMergedAnnotationAttributes(AnnotatedElementSE element, ClassSE<? extends AnnotationSE> annotationType, boolean classValuesAsString, boolean nestedAnnotationsAsMap)
element
の上のアノテーション階層内で指定された annotationType
の最初のアノテーションを検索し、そのアノテーションの属性を、アノテーション階層の下位レベルのアノテーションの一致する属性とマージします。 アノテーション階層の下位レベルの属性は、上位レベルの同じ名前の属性をオーバーライドし、@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされます。
getAllAnnotationAttributes(java.lang.reflect.AnnotatedElement, java.lang.String)
とは異なり、このメソッドで使用される検索アルゴリズムは、指定された annotationType
の最初のアノテーションが見つかると、アノテーション階層の検索を停止します。結果として、指定された annotationType
の追加のアノテーションは無視されます。
このメソッドは、クラスレベルの javadoc で説明されている検索セマンティクスに従います。
element
- アノテーション付き要素 annotationType
- 検索するアノテーション型 classValuesAsString
- クラス参照を文字列に変換するか、クラス参照として保持するか nestedAnnotationsAsMap
- ネストされた Annotation インスタンスを AnnotationAttributes
マップに変換するか、Annotation インスタンスとして保持するか AnnotationAttributes
、または見つからない場合は null
findMergedAnnotation(AnnotatedElement, Class)
, getMergedAnnotationAttributes(AnnotatedElement, String, boolean, boolean)
@Nullable public static AnnotationAttributes findMergedAnnotationAttributes(AnnotatedElementSE element, StringSE annotationName, boolean classValuesAsString, boolean nestedAnnotationsAsMap)
element
の上のアノテーション階層内で指定された annotationName
の最初のアノテーションを検索し、そのアノテーションの属性を、アノテーション階層の下位レベルのアノテーションの一致する属性とマージします。 アノテーション階層の下位レベルの属性は、上位レベルの同じ名前の属性をオーバーライドし、@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされます。
getAllAnnotationAttributes(java.lang.reflect.AnnotatedElement, java.lang.String)
とは異なり、このメソッドで使用される検索アルゴリズムは、指定された annotationName
の最初のアノテーションが見つかると、アノテーション階層の検索を停止します。結果として、指定された annotationName
の追加のアノテーションは無視されます。
このメソッドは、クラスレベルの javadoc で説明されている検索セマンティクスに従います。
element
- アノテーション付き要素 annotationName
- 検索するアノテーション型の完全修飾クラス名 classValuesAsString
- クラス参照を文字列に変換するか、クラス参照として保持するか nestedAnnotationsAsMap
- ネストされた Annotation インスタンスを AnnotationAttributes
マップに変換するか、Annotation インスタンスとして保持するか AnnotationAttributes
、または見つからない場合は null
findMergedAnnotation(AnnotatedElement, Class)
, getMergedAnnotationAttributes(AnnotatedElement, String, boolean, boolean)
@Nullable public static <A extends AnnotationSE> A findMergedAnnotation(AnnotatedElementSE element, ClassSE<A> annotationType)
element
の上のアノテーション階層内で指定された annotationType
の最初のアノテーションを見つけ、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションからの一致する属性とマージし、結果を指定された annotationType
のアノテーションに合成します。@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは、クラスレベルの javadoc で説明されている検索セマンティクスに従います。
element
- アノテーション付き要素 annotationType
- 検索するアノテーション型 Annotation
、見つからない場合は null
findAllMergedAnnotations(AnnotatedElement, Class)
, findMergedAnnotationAttributes(AnnotatedElement, String, boolean, boolean)
, getMergedAnnotationAttributes(AnnotatedElement, Class)
public static <A extends AnnotationSE> SetSE<A> findAllMergedAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType)
element
の上のアノテーション階層内で、指定された annotationType
のすべてのアノテーションを検索します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType
のアノテーションに合成します。@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは、クラスレベルの javadoc で説明されている検索セマンティクスに従います。
element
- アノテーション付き要素 (非 null
)annotationType
- 検索するアノテーション型 (非 null
)Annotations
のセットが見つかりました。見つからなかった場合は空のセット findMergedAnnotation(AnnotatedElement, Class)
, getAllMergedAnnotations(AnnotatedElement, Class)
public static SetSE<AnnotationSE> findAllMergedAnnotations(AnnotatedElementSE element, SetSE<ClassSE<? extends AnnotationSE>> annotationTypes)
element
の上のアノテーション階層内で、指定された annotationTypes
のすべてのアノテーションを検索します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を対応する annotationType
のアノテーションに合成します。@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは、クラスレベルの javadoc で説明されている検索セマンティクスに従います。
element
- アノテーション付き要素 (非 null
)annotationTypes
- 検索するアノテーション型 Annotations
のセットが見つかりました。見つからなかった場合は空のセット findAllMergedAnnotations(AnnotatedElement, Class)
public static <A extends AnnotationSE> SetSE<A> findMergedRepeatableAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType)
element
の上のアノテーション階層内で、指定された annotationType
のすべての繰り返し可能なアノテーションを検索します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType
のアノテーションに合成します。 繰り返し可能なアノテーションを保持するコンテナー型は、Repeatable
SE を介して検索されます。
@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは、クラスレベルの javadoc で説明されている検索セマンティクスに従います。
element
- アノテーション付き要素 (非 null
)annotationType
- 検索するアノテーション型 (非 null
)Annotations
のセット、または何も見つからなかった場合は空のセット IllegalArgumentExceptionSE
- element
または annotationType
が null
である場合、またはコンテナー型を解決できない場合 findMergedAnnotation(AnnotatedElement, Class)
, findAllMergedAnnotations(AnnotatedElement, Class)
, findMergedRepeatableAnnotations(AnnotatedElement, Class, Class)
public static <A extends AnnotationSE> SetSE<A> findMergedRepeatableAnnotations(AnnotatedElementSE element, ClassSE<A> annotationType, @Nullable ClassSE<? extends AnnotationSE> containerType)
element
の上のアノテーション階層内で、指定された annotationType
のすべての繰り返し可能なアノテーションを検索します。見つかった各アノテーションについて、そのアノテーションの属性をアノテーション階層の下位レベルのアノテーションの一致する属性とマージし、結果を指定された annotationType
のアノテーションに合成します。@AliasFor
セマンティクスは、単一のアノテーション内とアノテーション階層内の両方で完全にサポートされています。
このメソッドは、クラスレベルの javadoc で説明されている検索セマンティクスに従います。
element
- アノテーション付き要素 (非 null
)annotationType
- 検索するアノテーション型 (非 null
)containerType
- アノテーションを保持するコンテナーの型。コンテナー型を Repeatable
SE でルックアップする必要がある場合は、null
の場合があります Annotations
のセット、または何も見つからなかった場合は空のセット IllegalArgumentExceptionSE
- element
または annotationType
が null
である場合、またはコンテナー型を解決できない場合 AnnotationConfigurationException
- 指定された containerType
が指定された annotationType
の有効なコンテナーアノテーションでない場合 findMergedAnnotation(AnnotatedElement, Class)
, findAllMergedAnnotations(AnnotatedElement, Class)