インタフェースTypeAnnotation.TargetInfo
- 既知のすべてのサブインタフェース:
TypeAnnotation.CatchTarget,TypeAnnotation.EmptyTarget,TypeAnnotation.FormalParameterTarget,TypeAnnotation.LocalVarTarget,TypeAnnotation.OffsetTarget,TypeAnnotation.SupertypeTarget,TypeAnnotation.ThrowsTarget,TypeAnnotation.TypeArgumentTarget,TypeAnnotation.TypeParameterBoundTarget,TypeAnnotation.TypeParameterTarget
- 含まれているインタフェース:
TypeAnnotation
public static sealed interface TypeAnnotation.TargetInfo permits TypeAnnotation.TypeParameterTarget, TypeAnnotation.SupertypeTarget, TypeAnnotation.TypeParameterBoundTarget, TypeAnnotation.EmptyTarget, TypeAnnotation.FormalParameterTarget, TypeAnnotation.ThrowsTarget, TypeAnnotation.LocalVarTarget, TypeAnnotation.CatchTarget, TypeAnnotation.OffsetTarget, TypeAnnotation.TypeArgumentTarget
宣言または式のどの型に注釈を付けるかを指定します。
-
フィールドのサマリー
フィールド修飾子と型フィールド説明static final int注釈「ターゲット・タイプ」CAST型のvalue。static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int注釈「ターゲット・タイプ」FIELD型のvalue。static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int注釈「ターゲット・タイプ」NEW型のvalue。static final intstatic final int注釈「ターゲット・タイプ」THROWS型のvalue。 -
メソッドのサマリー
修飾子と型メソッド説明static TypeAnnotation.EmptyTargetof(TypeAnnotation.TargetType targetType) 注釈のターゲットを返します。ofCastExpr(Label target, int typeArgumentIndex) キャスト式のi番目の型の注釈のターゲットを返します。ofClassExtends(int supertypeIndex) "extends"句または"implements"句の型に関する注釈のターゲットを返します。ofClassTypeParameter(int typeParameterIndex) クラス型パラメータ宣言の注釈のターゲットを返します。ofClassTypeParameterBound(int typeParameterIndex, int boundIndex) ジェネリック・クラスまたはインタフェースのj番目の型パラメータ宣言のi番目の境界にある注釈のターゲットを返します。ofConstructorInvocationTypeArgument(Label target, int typeArgumentIndex) 明示的なコンストラクタ呼出し文の明示的な型引数リストにあるi番目の型引数に対する注釈のターゲットを返します。static TypeAnnotation.OffsetTargetofConstructorReference(Label target) コンストラクタ参照式で::の前に型に対する注釈のターゲットを返します。ofConstructorReferenceTypeArgument(Label target, int typeArgumentIndex) 新しい式の明示的な型引数リストにあるi番目の型引数に対する注釈のターゲットを返します。static TypeAnnotation.CatchTargetofExceptionParameter(int exceptionTableIndex) 例外パラメータ宣言のi番目の型の注釈のターゲットを返します。static TypeAnnotation.EmptyTargetofField()フィールドまたはレコード宣言内の型の注釈のターゲットを返します。static TypeAnnotation.OffsetTargetofInstanceofExpr(Label target) instanceof式内の型に対する注釈のターゲットを返します。ローカル変数宣言内の型に対する注釈のターゲットを返します。ofMethodFormalParameter(int formalParameterIndex) メソッド、コンストラクタまたはラムダ式の仮パラメータ宣言内の型に対する注釈のターゲットを返します。ofMethodInvocationTypeArgument(Label target, int typeArgumentIndex) メソッド呼出し式の明示的な型引数リストにあるi番目の型引数に対する注釈のターゲットを返します。static TypeAnnotation.EmptyTargetメソッドまたはコンストラクタのレシーバ・タイプに対する注釈のターゲットを返します。static TypeAnnotation.OffsetTargetofMethodReference(Label target) メソッド参照式内の::前の型の注釈のターゲットを返します。ofMethodReferenceTypeArgument(Label target, int typeArgumentIndex) メソッド参照式の明示的な型引数リストにあるi番目の型引数に対する注釈のターゲットを返します。static TypeAnnotation.EmptyTargetメソッドの戻り型または新しく構築されたオブジェクトの注釈のターゲットを返します。ofMethodTypeParameter(int typeParameterIndex) メソッド型パラメータ宣言の注釈のターゲットを返します。ofMethodTypeParameterBound(int typeParameterIndex, int boundIndex) ジェネリック・メソッドまたはコンストラクタのj番目の型パラメータ宣言のi番目の境界にある注釈のターゲットを返します。static TypeAnnotation.OffsetTarget新しい式内の型に対する注釈のターゲットを返します。static TypeAnnotation.OffsetTargetofOffset(TypeAnnotation.TargetType targetType, Label target) instanceof式または新しい式内の型、またはメソッド参照式内の::前の型の注釈のターゲットを返します。try-with-resources文でリソースとして宣言されたローカル変数内の型に対する注釈のターゲットを返します。static TypeAnnotation.ThrowsTargetofThrows(int throwsTargetIndex) メソッドまたはコンストラクタ宣言のthrows句のi番目の型に対する注釈のターゲットを返します。ofTypeArgument(TypeAnnotation.TargetType targetType, Label target, int typeArgumentIndex) キャスト式内のi番目の型、または明示的な型引数リスト内のi番目の型引数で、次のいずれかの注釈のターゲットを返します: 新しい式、明示的なコンストラクタ呼出し文、メソッド呼出し式またはメソッド参照式。ofTypeParameter(TypeAnnotation.TargetType targetType, int typeParameterIndex) クラスまたはメソッド型のパラメータ宣言の注釈のターゲットを返します。ofTypeParameterBound(TypeAnnotation.TargetType targetType, int typeParameterIndex, int boundIndex) 汎用クラス、インタフェース、メソッドまたはコンストラクタのj番目の型パラメータ宣言のi番目の境界にある注釈のターゲットを返します。ofVariable(TypeAnnotation.TargetType targetType, List<TypeAnnotation.LocalVarTargetInfo> table) try-with-resources文でリソースとして宣言された変数を含む、ローカル変数宣言内の型に対する注釈のターゲットを返します。default intsize()ターゲット情報のサイズを返します。ターゲットのタイプを返します。
-
フィールド詳細
-
TARGET_CLASS_TYPE_PARAMETER
-
TARGET_METHOD_TYPE_PARAMETER
-
TARGET_CLASS_EXTENDS
-
TARGET_CLASS_TYPE_PARAMETER_BOUND
static final int TARGET_CLASS_TYPE_PARAMETER_BOUND- 関連項目:
-
TARGET_METHOD_TYPE_PARAMETER_BOUND
static final int TARGET_METHOD_TYPE_PARAMETER_BOUND- 関連項目:
-
TARGET_FIELD
-
TARGET_METHOD_RETURN
-
TARGET_METHOD_RECEIVER
-
TARGET_METHOD_FORMAL_PARAMETER
-
TARGET_THROWS
-
TARGET_LOCAL_VARIABLE
-
TARGET_RESOURCE_VARIABLE
-
TARGET_EXCEPTION_PARAMETER
-
TARGET_INSTANCEOF
-
TARGET_NEW
-
TARGET_CONSTRUCTOR_REFERENCE
-
TARGET_METHOD_REFERENCE
-
TARGET_CAST
-
TARGET_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
static final int TARGET_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT- 関連項目:
-
TARGET_METHOD_INVOCATION_TYPE_ARGUMENT
static final int TARGET_METHOD_INVOCATION_TYPE_ARGUMENT- 関連項目:
-
TARGET_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
static final int TARGET_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT- 関連項目:
-
TARGET_METHOD_REFERENCE_TYPE_ARGUMENT
static final int TARGET_METHOD_REFERENCE_TYPE_ARGUMENT- 関連項目:
-
-
メソッドの詳細
-
targetType
-
size
default int size()ターゲット情報のサイズを返します。- 戻り値:
- ターゲット情報のサイズ
-
ofTypeParameter
static TypeAnnotation.TypeParameterTarget ofTypeParameter(TypeAnnotation.TargetType targetType, int typeParameterIndex) クラスまたはメソッド型のパラメータ宣言の注釈のターゲットを返します。- パラメータ:
targetType-TypeAnnotation.TargetType.CLASS_TYPE_PARAMETERまたはTypeAnnotation.TargetType.METHOD_TYPE_PARAMETERtypeParameterIndex- 注釈を付ける型パラメータ宣言を指定します。- 戻り値:
- クラスまたはメソッド型のパラメータ宣言の注釈のターゲット
-
ofClassTypeParameter
static TypeAnnotation.TypeParameterTarget ofClassTypeParameter(int typeParameterIndex) クラス型パラメータ宣言の注釈のターゲットを返します。- パラメータ:
typeParameterIndex- 注釈を付ける型パラメータ宣言を指定します。- 戻り値:
- クラス型パラメータ宣言の注釈のターゲット
-
ofMethodTypeParameter
static TypeAnnotation.TypeParameterTarget ofMethodTypeParameter(int typeParameterIndex) メソッド型パラメータ宣言の注釈のターゲットを返します。- パラメータ:
typeParameterIndex- 注釈を付ける型パラメータ宣言を指定します。- 戻り値:
- メソッド型パラメータ宣言の注釈のターゲット
-
ofClassExtends
static TypeAnnotation.SupertypeTarget ofClassExtends(int supertypeIndex) "extends"句または"implements"句の型に関する注釈のターゲットを返します。- パラメータ:
supertypeIndex- インタフェース配列への索引、またはスーパークラスであることを示す65535- 戻り値:
- "extends"句または"implements"句の型に対する注釈のターゲット
-
ofTypeParameterBound
static TypeAnnotation.TypeParameterBoundTarget ofTypeParameterBound(TypeAnnotation.TargetType targetType, int typeParameterIndex, int boundIndex) 汎用クラス、インタフェース、メソッドまたはコンストラクタのj番目の型パラメータ宣言のi番目の境界にある注釈のターゲットを返します。- パラメータ:
targetType-TypeAnnotation.TargetType.CLASS_TYPE_PARAMETER_BOUNDまたはTypeAnnotation.TargetType.METHOD_TYPE_PARAMETER_BOUNDtypeParameterIndex- 注釈を付ける型パラメータ宣言を指定します。boundIndex- 型パラメータ宣言のどの境界に注釈を付けるかを指定します- 戻り値:
- 汎用クラス、インタフェース、メソッドまたはコンストラクタのj番目の型パラメータ宣言のi番目の境界にある注釈のターゲット
-
ofClassTypeParameterBound
static TypeAnnotation.TypeParameterBoundTarget ofClassTypeParameterBound(int typeParameterIndex, int boundIndex) ジェネリック・クラスまたはインタフェースのj番目の型パラメータ宣言のi番目の境界にある注釈のターゲットを返します。- パラメータ:
typeParameterIndex- 注釈を付ける型パラメータ宣言を指定します。boundIndex- 型パラメータ宣言のどの境界に注釈を付けるかを指定します- 戻り値:
- 汎用クラスまたはインタフェースのj番目の型パラメータ宣言のi番目の境界にある注釈のターゲット
-
ofMethodTypeParameterBound
static TypeAnnotation.TypeParameterBoundTarget ofMethodTypeParameterBound(int typeParameterIndex, int boundIndex) ジェネリック・メソッドまたはコンストラクタのj番目の型パラメータ宣言のi番目の境界にある注釈のターゲットを返します。- パラメータ:
typeParameterIndex- 注釈を付ける型パラメータ宣言を指定します。boundIndex- 型パラメータ宣言のどの境界に注釈を付けるかを指定します- 戻り値:
- ジェネリック・メソッドまたはコンストラクタのj番目の型パラメータ宣言のi番目の境界にある注釈のターゲット
-
of
static TypeAnnotation.EmptyTarget of(TypeAnnotation.TargetType targetType) 注釈のターゲットを返します。- パラメータ:
targetType-TypeAnnotation.TargetType.FIELD、TypeAnnotation.TargetType.METHOD_RETURNまたはTypeAnnotation.TargetType.METHOD_RECEIVER- 戻り値:
- 注釈のターゲット
-
ofField
static TypeAnnotation.EmptyTarget ofField()フィールドまたはレコード宣言内の型の注釈のターゲットを返します。- 戻り値:
- フィールドまたはレコード宣言内の型に対する注釈のターゲット
-
ofMethodReturn
static TypeAnnotation.EmptyTarget ofMethodReturn()メソッドの戻り型または新しく構築されたオブジェクトの注釈のターゲットを返します。- 戻り値:
- メソッドの戻り型または新しく構築されたオブジェクトの注釈のターゲット
-
ofMethodReceiver
static TypeAnnotation.EmptyTarget ofMethodReceiver()メソッドまたはコンストラクタのレシーバ・タイプに対する注釈のターゲットを返します。- 戻り値:
- メソッドまたはコンストラクタの受信側タイプでの注釈のターゲット
-
ofMethodFormalParameter
static TypeAnnotation.FormalParameterTarget ofMethodFormalParameter(int formalParameterIndex) メソッド、コンストラクタまたはラムダ式の仮パラメータ宣言内の型に対する注釈のターゲットを返します。 一部の合成パラメータまたは暗黙的なパラメータが省略されているため、メソッド記述子の索引と異なる場合があります。- パラメータ:
formalParameterIndex- 注釈付き型を持つ仮パラメータ宣言を指定します。- 戻り値:
- メソッド、コンストラクタまたはラムダ式の仮パラメータ宣言内の型に対する注釈のターゲット
-
ofThrows
static TypeAnnotation.ThrowsTarget ofThrows(int throwsTargetIndex) メソッドまたはコンストラクタ宣言のthrows句のi番目の型に対する注釈のターゲットを返します。- パラメータ:
throwsTargetIndex- メソッドの例外属性の例外表への索引- 戻り値:
- メソッドまたはコンストラクタ宣言のthrows句のi番目の型に対する注釈のターゲット
-
ofVariable
static TypeAnnotation.LocalVarTarget ofVariable(TypeAnnotation.TargetType targetType, List<TypeAnnotation.LocalVarTargetInfo> table) try-with-resources文でリソースとして宣言された変数を含む、ローカル変数宣言内の型に対する注釈のターゲットを返します。- パラメータ:
targetType-TypeAnnotation.TargetType.LOCAL_VARIABLEまたはTypeAnnotation.TargetType.RESOURCE_VARIABLEtable- ローカル変数ターゲットのリスト- 戻り値:
- try-with-resources文でリソースとして宣言された変数を含む、ローカル変数宣言内の型に対する注釈のターゲット
-
ofLocalVariable
static TypeAnnotation.LocalVarTarget ofLocalVariable(List<TypeAnnotation.LocalVarTargetInfo> table) ローカル変数宣言内の型に対する注釈のターゲットを返します。- パラメータ:
table- ローカル変数ターゲットのリスト- 戻り値:
- ローカル変数宣言内の型に対する注釈のターゲット
-
ofResourceVariable
static TypeAnnotation.LocalVarTarget ofResourceVariable(List<TypeAnnotation.LocalVarTargetInfo> table) try-with-resources文でリソースとして宣言されたローカル変数内の型に対する注釈のターゲットを返します。- パラメータ:
table- ローカル変数ターゲットのリスト- 戻り値:
- try-with-resources文でリソースとして宣言されたローカル変数内の型に対する注釈のターゲット
-
ofExceptionParameter
static TypeAnnotation.CatchTarget ofExceptionParameter(int exceptionTableIndex) 例外パラメータ宣言のi番目の型の注釈のターゲットを返します。- パラメータ:
exceptionTableIndex- Code属性の例外表への索引- 戻り値:
- 例外パラメータ宣言のi番目の型に対する注釈のターゲット
-
ofOffset
static TypeAnnotation.OffsetTarget ofOffset(TypeAnnotation.TargetType targetType, Label target) instanceof式または新しい式内の型、またはメソッド参照式内の::前の型の注釈のターゲットを返します。- パラメータ:
targetType-TypeAnnotation.TargetType.INSTANCEOF、TypeAnnotation.TargetType.NEW、TypeAnnotation.TargetType.CONSTRUCTOR_REFERENCEまたはTypeAnnotation.TargetType.METHOD_REFERENCEtarget- 指示の直前のラベル- 戻り値:
- instanceof式または新しい式内の型に対する注釈のターゲット、またはメソッド参照式内の::より前の型
-
ofInstanceofExpr
static TypeAnnotation.OffsetTarget ofInstanceofExpr(Label target) instanceof式内の型に対する注釈のターゲットを返します。- パラメータ:
target- 指示の直前のラベル- 戻り値:
- instanceof式内の型に対する注釈のターゲット
-
ofNewExpr
static TypeAnnotation.OffsetTarget ofNewExpr(Label target) 新しい式内の型に対する注釈のターゲットを返します。- パラメータ:
target- 指示の直前のラベル- 戻り値:
- 新しい式の型に対する注釈のターゲット
-
ofConstructorReference
static TypeAnnotation.OffsetTarget ofConstructorReference(Label target) コンストラクタ参照式で::の前に型に対する注釈のターゲットを返します。- パラメータ:
target- 指示の直前のラベル- 戻り値:
- コンストラクタ参照式で::の前の型に対する注釈のターゲット
-
ofMethodReference
static TypeAnnotation.OffsetTarget ofMethodReference(Label target) メソッド参照式内の::前の型の注釈のターゲットを返します。- パラメータ:
target- 指示の直前のラベル- 戻り値:
- メソッド参照式で::の前の型に対する注釈のターゲット
-
ofTypeArgument
static TypeAnnotation.TypeArgumentTarget ofTypeArgument(TypeAnnotation.TargetType targetType, Label target, int typeArgumentIndex) キャスト式内のi番目の型、または明示的な型引数リスト内のi番目の型引数で、次のいずれかの注釈のターゲットを返します: 新しい式、明示的なコンストラクタ呼出し文、メソッド呼出し式またはメソッド参照式。- パラメータ:
targetType-TypeAnnotation.TargetType.CAST、TypeAnnotation.TargetType.CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT、TypeAnnotation.TargetType.METHOD_INVOCATION_TYPE_ARGUMENT、TypeAnnotation.TargetType.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENTまたはTypeAnnotation.TargetType.METHOD_REFERENCE_TYPE_ARGUMENTtarget- 指示の直前のラベルtypeArgumentIndex- キャスト演算子または引数のどの型に注釈を付けるかを指定します- 戻り値:
- キャスト式内のi番目の型に対する注釈のターゲット、または次のいずれかの明示的な型引数リストのi番目の型引数: 新しい式、明示的なコンストラクタ呼出し文、メソッド呼出し式またはメソッド参照式
-
ofCastExpr
static TypeAnnotation.TypeArgumentTarget ofCastExpr(Label target, int typeArgumentIndex) キャスト式のi番目の型の注釈のターゲットを返します。- パラメータ:
target- 指示の直前のラベルtypeArgumentIndex- キャスト演算子で注釈を付ける型を指定します。- 戻り値:
- キャスト式のi番目の型に対する注釈のターゲット
-
ofConstructorInvocationTypeArgument
static TypeAnnotation.TypeArgumentTarget ofConstructorInvocationTypeArgument(Label target, int typeArgumentIndex) 明示的なコンストラクタ呼出し文の明示的な型引数リストにあるi番目の型引数に対する注釈のターゲットを返します。- パラメータ:
target- 指示の直前のラベルtypeArgumentIndex- 引数のどの型に注釈を付けるかを指定します。- 戻り値:
- 明示的なコンストラクタ呼出し文の明示的な型引数リストにあるi番目の型引数に対する注釈のターゲット
-
ofMethodInvocationTypeArgument
static TypeAnnotation.TypeArgumentTarget ofMethodInvocationTypeArgument(Label target, int typeArgumentIndex) メソッド呼出し式の明示的な型引数リストにあるi番目の型引数に対する注釈のターゲットを返します。- パラメータ:
target- 指示の直前のラベルtypeArgumentIndex- 引数のどの型に注釈を付けるかを指定します。- 戻り値:
- メソッド呼出し式の明示的な型引数リストにあるi番目の型引数に対する注釈のターゲット
-
ofConstructorReferenceTypeArgument
static TypeAnnotation.TypeArgumentTarget ofConstructorReferenceTypeArgument(Label target, int typeArgumentIndex) 新しい式の明示的な型引数リストにあるi番目の型引数に対する注釈のターゲットを返します。- パラメータ:
target- 指示の直前のラベルtypeArgumentIndex- 引数のどの型に注釈を付けるかを指定します。- 戻り値:
- 新しい式の明示的な型引数リストのi番目の型引数に対する注釈のターゲット
-
ofMethodReferenceTypeArgument
static TypeAnnotation.TypeArgumentTarget ofMethodReferenceTypeArgument(Label target, int typeArgumentIndex) メソッド参照式の明示的な型引数リストにあるi番目の型引数に対する注釈のターゲットを返します。- パラメータ:
target- 指示の直前のラベルtypeArgumentIndex- 引数のどの型に注釈を付けるかを指定します。- 戻り値:
- メソッド参照式の明示的な型引数リストにあるi番目の型引数に対する注釈のターゲット
-