インタフェースjava.lang.constant.MethodTypeDescの
使用
| パッケージ | 説明 |
|---|---|
| java.lang.constant |
クラスやメソッド・ハンドルなどのランタイム・エンティティ用に「名目記述子」を表すクラスおよびインタフェース、および定数プール・エントリや
invokedynamicコール・サイトなどのクラス・ファイル・エンティティ用に「名目記述子」を表すクラスおよびインタフェース。 |
| java.lang.invoke |
java.lang.invokeパッケージは、Java Virtual Machineとやりとりするための低レベルのプリミティブを提供します。 |
-
java.lang.constantでのMethodTypeDescの使用
MethodTypeDescを戻すjava.lang.constantのメソッド 修飾子と型 メソッド 説明 MethodTypeDescMethodTypeDesc. changeParameterType(int index, ClassDesc paramType)このタイプと同一のMethodTypeDescを返します。ただし、指定されたタイプに変更されたパラメータ・タイプは1つのみです。MethodTypeDescMethodTypeDesc. changeReturnType(ClassDesc returnType)指定された戻り型を除き、これと同一のMethodTypeDescを返します。MethodTypeDescMethodTypeDesc. dropParameterTypes(int start, int end)パラメータ・タイプの範囲が削除されたことを除き、この方法と同じMethodTypeDescを返します。MethodTypeDescMethodTypeDesc. insertParameterTypes(int pos, ClassDesc... paramTypes)このパラメータ・タイプが追加されたことを除き、同じMethodTypeDescを返します。MethodTypeDescDynamicCallSiteDesc. invocationType()invokedynamicのNameAndTypeオペランドに表示される呼び出しタイプを示すMethodTypeDescを返します。MethodTypeDescMethodHandleDesc. invocationType()この名目記述子で記述されるメソッド・ハンドルの呼出しタイプを記述するMethodTypeDescを返します。static MethodTypeDescMethodTypeDesc. of(ClassDesc returnDesc, ClassDesc... paramDescs)戻り型およびパラメータ型が指定されたMethodTypeDescを返します。static MethodTypeDescMethodTypeDesc. ofDescriptor(String descriptor)メソッド記述子文字列を指定してMethodTypeDescを作成します。型MethodTypeDescのパラメータを持つjava.lang.constantのメソッド 修飾子と型 メソッド 説明 default MethodHandleDescMethodHandleDesc. asType(MethodTypeDesc type)MethodHandle.asType(MethodType)が適応するこのメソッド・ハンドルを説明するMethodHandleDescを返します。static DynamicCallSiteDescDynamicCallSiteDesc. of(DirectMethodHandleDesc bootstrapMethod, MethodTypeDesc invocationType)ブートストラップ・メソッドに静的引数がなく、nameパラメータがConstantDescs.DEFAULT_NAMEのinvokedynamicコール・サイトに名目記述子を作成します。static DynamicCallSiteDescDynamicCallSiteDesc. of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType)ブートストラップ・メソッドに静的な引数がないinvokedynamicコール・サイトの名目記述子を作成します。static DynamicCallSiteDescDynamicCallSiteDesc. of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType, ConstantDesc... bootstrapArgs)invokedynamiccallサイトの名目記述子を作成します。static DirectMethodHandleDescMethodHandleDesc. ofMethod(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String name, MethodTypeDesc lookupMethodType)宣言されたメソッドまたはコンストラクタの呼出しに対応するMethodHandleDescを作成します。DynamicCallSiteDescDynamicCallSiteDesc. withNameAndType(String invocationName, MethodTypeDesc invocationType)ブートストラップおよびブートストラップ引数がこれと同じですが、指定されたinvocationNameと呼出しinvocationTypeを使用して、invokedynamicコール・サイトの名目記述子を返します -
java.lang.invokeでのMethodTypeDescの使用
型MethodTypeDescの引数を持つ型を返すjava.lang.invokeのメソッド 修飾子と型 メソッド 説明 Optional<MethodTypeDesc>MethodType. describeConstable()このインスタンスの名目記述子を返します(作成可能な場合)、作成できない場合は空のOptionalを返します。