public class AnnotationAttributes extends LinkedHashMapSE<StringSE,ObjectSE>
AnnotationUtils
、AnnotatedElementUtils
、Spring の反射ベースおよび ASM ベースの AnnotationMetadata
実装によって読み取られるアノテーション属性のキーと値のペアを表す LinkedHashMap
SE サブクラス。型安全なメソッドでアノテーション属性を検索するための便利なメソッドと同様に、呼び出しコード内のノイズの多い Map ジェネリクスを回避するための「疑似具体化」を提供します。
AnnotationUtils.getAnnotationAttributes(java.lang.annotation.Annotation)
, AnnotatedElementUtils
, 直列化された形式 AbstractMap.SimpleEntrySE<KSE, VSE>, AbstractMap.SimpleImmutableEntrySE<KSE, VSE>
コンストラクターと説明 |
---|
AnnotationAttributes() 新しい空の AnnotationAttributes インスタンスを作成します。 |
AnnotationAttributes(AnnotationAttributes other) 新しい AnnotationAttributes インスタンスを作成し、提供されたマップとそのすべてのキーと値のペアをラップします。 |
AnnotationAttributes(ClassSE<? extends AnnotationSE> annotationType) 指定された annotationType の新しい空の AnnotationAttributes インスタンスを作成します。 |
AnnotationAttributes(int initialCapacity) 指定された初期容量で新しい空の AnnotationAttributes インスタンスを作成して、パフォーマンスを最適化します。 |
AnnotationAttributes(MapSE<StringSE, ObjectSE> map) 新しい AnnotationAttributes インスタンスを作成し、提供されたマップとそのすべてのキーと値のペアをラップします。 |
AnnotationAttributes(StringSE annotationType, ClassLoaderSE classLoader) 指定された annotationType の新しい空の AnnotationAttributes インスタンスを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
ClassSE<? extends AnnotationSE> | annotationType() この AnnotationAttributes によって表されるアノテーションの型を取得します。 |
static AnnotationAttributes | fromMap(MapSE<StringSE, ObjectSE> map) 指定されたマップに基づいて AnnotationAttributes インスタンスを返します。 |
AnnotationAttributes | getAnnotation(StringSE attributeName) 指定された attributeName に保存されている AnnotationAttributes を取得します。 |
<A extends AnnotationSE> | getAnnotation(StringSE attributeName, ClassSE<A> annotationType) 指定された attributeName に格納されている型 annotationType のアノテーションを取得します。 |
AnnotationAttributes[] | getAnnotationArray(StringSE attributeName) 指定された attributeName に格納されている AnnotationAttributes の配列を取得します。 |
<A extends AnnotationSE> | getAnnotationArray(StringSE attributeName, ClassSE<A> annotationType) 指定された attributeName に格納されている型 annotationType の配列を取得します。 |
boolean | getBoolean(StringSE attributeName) 指定された attributeName に格納されている値をブール値として取得します。 |
<T> ClassSE<? extends T> | getClass(StringSE attributeName) 指定された attributeName にクラスとして保存されている値を取得します。 |
ClassSE<?>[] | getClassArray(StringSE attributeName) 指定された attributeName に格納されている値をクラスの配列として取得します。 |
<E extends EnumSE<?>> | getEnum(StringSE attributeName) 指定された attributeName に格納されている値を列挙として取得します。 |
<N extends NumberSE> | getNumber(StringSE attributeName) 指定された attributeName に保存されている値を数値として取得します。 |
StringSE | getString(StringSE attributeName) 指定された attributeName に格納されている値を文字列として取得します。 |
StringSE[] | getStringArray(StringSE attributeName) 指定された attributeName に格納されている値を文字列の配列として取得します。 |
StringSE | toString() |
clearSE, containsValueSE, entrySetSE, forEachSE, getSE, getOrDefaultSE, keySetSE, removeEldestEntrySE, replaceAllSE, valuesSE
cloneSE, computeSE, computeIfAbsentSE, computeIfPresentSE, containsKeySE, isEmptySE, mergeSE, putSE, putAllSE, putIfAbsentSE, removeSE, removeSE, replaceSE, replaceSE, sizeSE
equalsSE, hashCodeSE
finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
computeSE, computeIfAbsentSE, computeIfPresentSE, containsKeySE, equalsSE, hashCodeSE, isEmptySE, mergeSE, putSE, putAllSE, putIfAbsentSE, removeSE, removeSE, replaceSE, replaceSE, sizeSE
public AnnotationAttributes()
AnnotationAttributes
インスタンスを作成します。public AnnotationAttributes(int initialCapacity)
AnnotationAttributes
インスタンスを作成して、パフォーマンスを最適化します。initialCapacity
- 基本となるマップの初期サイズ public AnnotationAttributes(MapSE<StringSE,ObjectSE> map)
AnnotationAttributes
インスタンスを作成し、提供されたマップとそのすべてのキーと値のペアをラップします。map
- アノテーション属性のキーと値のペアの元のソース fromMap(Map)
public AnnotationAttributes(AnnotationAttributes other)
AnnotationAttributes
インスタンスを作成し、提供されたマップとそのすべてのキーと値のペアをラップします。other
- アノテーション属性のキーと値のペアの元のソース fromMap(Map)
public AnnotationAttributes(ClassSE<? extends AnnotationSE> annotationType)
annotationType
の新しい空の AnnotationAttributes
インスタンスを作成します。annotationType
- この AnnotationAttributes
インスタンスによって表されるアノテーションの型。null
public AnnotationAttributes(StringSE annotationType, @Nullable ClassLoaderSE classLoader)
annotationType
の新しい空の AnnotationAttributes
インスタンスを作成します。annotationType
- この AnnotationAttributes
インスタンスによって表されるアノテーション型の名前。null
classLoader
- アノテーション型をロードしようとする ClassLoader、またはアノテーション型名を格納するだけの null
@Nullable public ClassSE<? extends AnnotationSE> annotationType()
AnnotationAttributes
によって表されるアノテーションの型を取得します。null
public StringSE getString(StringSE attributeName)
attributeName
に格納されている値を文字列として取得します。attributeName
- 取得する属性の名前。null
または空ではありません IllegalArgumentExceptionSE
- 属性が存在しない場合、または予期された型ではない場合 public StringSE[] getStringArray(StringSE attributeName)
attributeName
に格納されている値を文字列の配列として取得します。 指定された attributeName
に格納されている値が文字列の場合、それを返す前に単一要素の配列にラップされます。
attributeName
- 取得する属性の名前。null
または空ではありません IllegalArgumentExceptionSE
- 属性が存在しない場合、または予期された型ではない場合 public boolean getBoolean(StringSE attributeName)
attributeName
に格納されている値をブール値として取得します。attributeName
- 取得する属性の名前。null
または空ではありません IllegalArgumentExceptionSE
- 属性が存在しない場合、または予期された型ではない場合 public <N extends NumberSE> N getNumber(StringSE attributeName)
attributeName
に保存されている値を数値として取得します。attributeName
- 取得する属性の名前。null
または空ではありません IllegalArgumentExceptionSE
- 属性が存在しない場合、または予期された型ではない場合 public <E extends EnumSE<?>> E getEnum(StringSE attributeName)
attributeName
に格納されている値を列挙として取得します。attributeName
- 取得する属性の名前。null
または空ではありません IllegalArgumentExceptionSE
- 属性が存在しない場合、または予期された型ではない場合 public <T> ClassSE<? extends T> getClass(StringSE attributeName)
attributeName
にクラスとして保存されている値を取得します。attributeName
- 取得する属性の名前。null
または空ではありません IllegalArgumentExceptionSE
- 属性が存在しない場合、または予期された型ではない場合 public ClassSE<?>[] getClassArray(StringSE attributeName)
attributeName
に格納されている値をクラスの配列として取得します。 指定された attributeName
に格納されている値がクラスの場合、それを返す前に単一要素の配列にラップされます。
attributeName
- 取得する属性の名前。null
または空ではありません IllegalArgumentExceptionSE
- 属性が存在しない場合、または予期された型ではない場合 public AnnotationAttributes getAnnotation(StringSE attributeName)
attributeName
に保存されている AnnotationAttributes
を取得します。 メモ: 実際のアノテーションが必要な場合は、代わりに getAnnotation(String, Class)
を呼び出してください。
attributeName
- 取得する属性の名前。null
または空ではありません AnnotationAttributes
IllegalArgumentExceptionSE
- 属性が存在しない場合、または予期された型ではない場合 public <A extends AnnotationSE> A getAnnotation(StringSE attributeName, ClassSE<A> annotationType)
attributeName
に格納されている型 annotationType
のアノテーションを取得します。attributeName
- 取得する属性の名前。null
または空ではありません annotationType
- 予期されるアノテーション型。null
IllegalArgumentExceptionSE
- 属性が存在しない場合、または予期された型ではない場合 public AnnotationAttributes[] getAnnotationArray(StringSE attributeName)
attributeName
に格納されている AnnotationAttributes
の配列を取得します。 指定された attributeName
に格納されている値が AnnotationAttributes
のインスタンスである場合、それを返す前に単一要素の配列にラップされます。
メモ: アノテーションの実際の配列が必要な場合は、代わりに getAnnotationArray(String, Class)
を呼び出します。
attributeName
- 取得する属性の名前。null
または空ではありません AnnotationAttributes
の配列 IllegalArgumentExceptionSE
- 属性が存在しない場合、または予期された型ではない場合 public <A extends AnnotationSE> A[] getAnnotationArray(StringSE attributeName, ClassSE<A> annotationType)
attributeName
に格納されている型 annotationType
の配列を取得します。 指定された attributeName
に格納されている値が Annotation
である場合、それを返す前に単一要素の配列にラップされます。
attributeName
- 取得する属性の名前。null
または空ではありません annotationType
- 予期されるアノテーション型。null
IllegalArgumentExceptionSE
- 属性が存在しない場合、または予期された型ではない場合 public StringSE toString()
AbstractMapSE<StringSE, ObjectSE>
の toStringSE
@Nullable public static AnnotationAttributes fromMap(@Nullable MapSE<StringSE,ObjectSE> map)
AnnotationAttributes
インスタンスを返します。 マップがすでに AnnotationAttributes
インスタンスである場合、新しいインスタンスを作成せずに、キャストされてすぐに返されます。それ以外の場合は、提供されたマップを AnnotationAttributes(Map)
コンストラクターに渡すことにより、新しいインスタンスが作成されます。
map
- アノテーション属性のキーと値のペアの元のソース