インタフェースAnnotationValue.OfConstant

すべてのスーパー・インタフェース:
AnnotationValue
既知のすべてのサブインタフェース:
AnnotationValue.OfBoolean, AnnotationValue.OfByte, AnnotationValue.OfChar, AnnotationValue.OfDouble, AnnotationValue.OfFloat, AnnotationValue.OfInt, AnnotationValue.OfLong, AnnotationValue.OfShort, AnnotationValue.OfString
含まれているインタフェース:
AnnotationValue

要素と値のペアの定数値をモデル化します。
シール済クラス階層グラフ:
AnnotationValue/OfConstantのシール済クラス階層グラフAnnotationValue/OfConstantのシール済クラス階層グラフ
導入されたバージョン:
24
  • メソッドの詳細

    • constant

      この定数要素を裏付ける定数プール・エントリを返します。
      APIのノート:
      定数値は同じ「計算タイプ」を持つため、同じタイプのエントリを共有できます。 たとえば、AnnotationValue.OfIntAnnotationValue.OfCharは両方ともIntegerEntryによってバックアップされます。 正確な型の値には、resolvedValue()を使用します。
      戻り値:
      この定数要素を裏付ける定数プール・エントリ
    • resolvedValue

      Constable resolvedValue()
      解決されたライブ定数値をオブジェクトとして返します。 戻り値の型は、ラッパー・クラスまたはStringです。
      APIのノート:
      返されるオブジェクトは、Constableであるにもかかわらず、クラス・ファイル内の注釈値をエンコードするための正しい定数をdescribeすることはできません。 たとえば、AnnotationValue.OfCharによって戻されるCharacterは、それ自体をDynamicConstantPoolEntryと表現しますが、実際には注釈形式でIntegerEntryによってバックアップされます。 constant()は、正しい定数プール表現に使用します。
      戻り値:
      解決されたライブ定数値をオブジェクトとして