インタフェースjava.lang.constant.ClassDescの
使用
ClassDescを使用するパッケージ
パッケージ
説明
Javaプログラミング言語の設計にあたり基本的なクラスを提供します。
クラスやメソッド・ハンドルなどのランタイム・エンティティ用に「名目記述子」を表すクラスおよびインタフェース、および定数プール・エントリや
invokedynamicコール・サイトなどのクラス・ファイル・エンティティ用に「名目記述子」を表すクラスおよびインタフェース。java.lang.invokeパッケージは、Java Virtual Machineとやりとりするための低レベルのプリミティブを提供します。-
java.langでのClassDescの使用
-
java.lang.constantでのClassDescの使用
ClassDescとして宣言されたjava.lang.constantのフィールド修飾子と型フィールド説明static ClassDescConstantDescs.CD_booleanプリミティブ・タイプbooleanを表すClassDescstatic ClassDescConstantDescs.CD_Booleanstatic ClassDescConstantDescs.CD_byteプリミティブ・タイプbyteを表すClassDescstatic ClassDescConstantDescs.CD_Bytestatic ClassDescConstantDescs.CD_CallSitestatic ClassDescConstantDescs.CD_charプリミティブ・タイプcharを表すClassDescstatic ClassDescConstantDescs.CD_Characterstatic ClassDescConstantDescs.CD_Classstatic ClassDescConstantDescs.CD_ClassDescstatic ClassDescConstantDescs.CD_Collectionstatic ClassDescConstantDescs.CD_ConstantBootstrapsstatic ClassDescConstantDescs.CD_ConstantDescstatic ClassDescConstantDescs.CD_DirectMethodHandleDescstatic ClassDescConstantDescs.CD_doubleプリミティブ・タイプdoubleを表すClassDescstatic ClassDescConstantDescs.CD_Doublestatic ClassDescConstantDescs.CD_DynamicCallSiteDescstatic ClassDescConstantDescs.CD_DynamicConstantDescstatic ClassDescConstantDescs.CD_Enumstatic ClassDescConstantDescs.CD_EnumDescstatic ClassDescConstantDescs.CD_Exceptionstatic ClassDescConstantDescs.CD_floatプリミティブ・タイプfloatを表すClassDescstatic ClassDescConstantDescs.CD_Floatstatic ClassDescConstantDescs.CD_intプリミティブ・タイプintを表すClassDescstatic ClassDescConstantDescs.CD_Integerstatic ClassDescConstantDescs.CD_Liststatic ClassDescConstantDescs.CD_longプリミティブ・タイプlongを表すClassDescstatic ClassDescConstantDescs.CD_Longstatic ClassDescConstantDescs.CD_Mapstatic ClassDescConstantDescs.CD_MethodHandlestatic ClassDescConstantDescs.CD_MethodHandleDescstatic ClassDescConstantDescs.CD_MethodHandleDesc_Kindstatic ClassDescConstantDescs.CD_MethodHandlesstatic ClassDescConstantDescs.CD_MethodHandles_Lookupstatic ClassDescConstantDescs.CD_MethodTypestatic ClassDescConstantDescs.CD_MethodTypeDescstatic ClassDescConstantDescs.CD_Numberstatic ClassDescConstantDescs.CD_Objectstatic ClassDescConstantDescs.CD_Setstatic ClassDescConstantDescs.CD_shortプリミティブ・タイプshortを表すClassDescstatic ClassDescConstantDescs.CD_Shortstatic ClassDescConstantDescs.CD_Stringstatic ClassDescConstantDescs.CD_Throwablestatic ClassDescConstantDescs.CD_VarHandlestatic ClassDescConstantDescs.CD_VarHandleDescstatic ClassDescConstantDescs.CD_voidプリミティブ・タイプvoidを表すClassDescstatic ClassDescConstantDescs.CD_VoidClassDescを返すjava.lang.constantのメソッド修飾子と型メソッド説明default ClassDescClassDesc.arrayType()default ClassDescClassDesc.arrayType(int rank)default ClassDescClassDesc.componentType()配列型を説明する場合はこのClassDescのコンポーネント型を返し、そうでない場合はnullを返します。DynamicConstantDesc.constantType()この定数に対してLDCのNameAndTypeオペランドに表示される型を示すClassDescを返します。default ClassDescdefault ClassDescstatic ClassDescクラスまたはインタフェース型に対して、"java.lang.String"などのクラスまたはインタフェースの名前を指定してClassDescを返します。static ClassDescクラスまたはインタフェース・タイプに対してClassDescを返します。クラスまたはインタフェースのパッケージ名および未修飾(simple)名が指定されます。static ClassDescClassDesc.ofDescriptor(String descriptor)クラス、インタフェース、配列またはプリミティブ・タイプの記述子文字列に対してClassDescを指定します。DirectMethodHandleDesc.owner()この名目記述子で説明するメソッドまたはフィールドを宣言するClassDescを返します。MethodTypeDesc.parameterArray()配列としてパラメータ型を返します。MethodTypeDesc.parameterType(int index)このMethodTypeDescで説明するメソッド・タイプのindex番目のパラメータのパラメータ・タイプを返します。MethodTypeDesc.returnType()MethodTypeDescで記述されたメソッド・タイプの戻り型を取得します。型ClassDescの引数を持つ型を返すjava.lang.constantのメソッド型ClassDescのパラメータを持つjava.lang.constantのメソッド修飾子と型メソッド説明MethodTypeDesc.changeParameterType(int index, ClassDesc paramType)このタイプと同一のMethodTypeDescを返します。ただし、指定されたタイプに変更されたパラメータ・タイプは1つのみです。MethodTypeDesc.changeReturnType(ClassDesc returnType)指定された戻り型を除き、これと同一のMethodTypeDescを返します。MethodTypeDesc.insertParameterTypes(int pos, ClassDesc... paramTypes)このパラメータ・タイプが追加されたことを除き、同じMethodTypeDescを返します。static DirectMethodHandleDescMethodHandleDesc.of(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String name, String lookupDescriptor)宣言されたメソッドの呼出し、コンストラクタの呼出し、またはフィールドへのアクセスに対応するMethodHandleDescを作成します。static MethodTypeDesc戻り型およびパラメータ型が指定されたMethodTypeDescを返します。static DirectMethodHandleDescConstantDescs.ofCallsiteBootstrap(ClassDesc owner, String name, ClassDesc returnType, ClassDesc... paramTypes)invokedynamic呼出しサイトのブートストラップ・メソッドに対応するMethodHandleDescを返します。これは先頭のパラメータ・タイプがLookup、String、MethodTypeである静的メソッドです。static <T> ConstantDescDynamicConstantDesc.ofCanonical(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc[] bootstrapArgs)定数ブートストラップが既知の単一記述子で、より具体的な記述子タイプ(例: ClassDesc)が使用可能な場合は、動的定数の名目記述子を返し、より具体的な型に変換します。static DirectMethodHandleDescConstantDescs.ofConstantBootstrap(ClassDesc owner, String name, ClassDesc returnType, ClassDesc... paramTypes)動的定数に対するブートストラップ・メソッドに対応するMethodHandleDescを返します。これは先行引数がLookup、String、Classであるstaticメソッドです。static DirectMethodHandleDescMethodHandleDesc.ofConstructor(ClassDesc owner, ClassDesc... paramTypes)コンストラクタの呼出しに対応するMethodHandleDescを返しますstatic DirectMethodHandleDescMethodHandleDesc.ofField(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String fieldName, ClassDesc fieldType)フィールドにアクセスするメソッド・ハンドルに対応するMethodHandleDescを作成します。static DirectMethodHandleDescMethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String name, MethodTypeDesc lookupMethodType)宣言されたメソッドまたはコンストラクタの呼出しに対応するMethodHandleDescを作成します。static <T> DynamicConstantDesc<T>DynamicConstantDesc.ofNamed(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc... bootstrapArgs)動的定数の名目記述子を返します。型ClassDescのパラメータを持つjava.lang.constantのコンストラクタ修飾子コンストラクタ説明protectedDynamicConstantDesc(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc... bootstrapArgs)動的定数の名目記述子を作成します。 -
java.lang.invokeでのClassDescの使用
ClassDescを返すjava.lang.invokeのメソッド型ClassDescのパラメータを持つjava.lang.invokeのメソッド修飾子と型メソッド説明static VarHandle.VarHandleDesc配列型のVarHandleに対応するVarHandle.VarHandleDescを返します。static VarHandle.VarHandleDescインスタンス・フィールドについて、VarHandleに対応するVarHandle.VarHandleDescを返します。static VarHandle.VarHandleDescVarHandle.VarHandleDesc.ofStaticField(ClassDesc declaringClass, String name, ClassDesc fieldType)静的フィールドについてVarHandleに対応するVarHandle.VarHandleDescを返します。