インタフェース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 final ClassDescConstantDescs.CD_booleanプリミティブ・タイプbooleanを表すClassDescstatic final ClassDescConstantDescs.CD_Booleanstatic final ClassDescConstantDescs.CD_byteプリミティブ・タイプbyteを表すClassDescstatic final ClassDescConstantDescs.CD_Bytestatic final ClassDescConstantDescs.CD_CallSitestatic final ClassDescConstantDescs.CD_charプリミティブ・タイプcharを表すClassDescstatic final ClassDescConstantDescs.CD_Characterstatic final ClassDescConstantDescs.CD_Classstatic final ClassDescConstantDescs.CD_ClassDescstatic final ClassDescConstantDescs.CD_Collectionstatic final ClassDescConstantDescs.CD_ConstantBootstrapsstatic final ClassDescConstantDescs.CD_ConstantDescstatic final ClassDescConstantDescs.CD_DirectMethodHandleDescstatic final ClassDescConstantDescs.CD_doubleプリミティブ・タイプdoubleを表すClassDescstatic final ClassDescConstantDescs.CD_Doublestatic final ClassDescConstantDescs.CD_DynamicCallSiteDescstatic final ClassDescConstantDescs.CD_DynamicConstantDescstatic final ClassDescConstantDescs.CD_Enumstatic final ClassDescConstantDescs.CD_EnumDescstatic final ClassDescConstantDescs.CD_Exceptionstatic final ClassDescConstantDescs.CD_floatプリミティブ・タイプfloatを表すClassDescstatic final ClassDescConstantDescs.CD_Floatstatic final ClassDescConstantDescs.CD_intプリミティブ・タイプintを表すClassDescstatic final ClassDescConstantDescs.CD_Integerstatic final ClassDescConstantDescs.CD_Liststatic final ClassDescConstantDescs.CD_longプリミティブ・タイプlongを表すClassDescstatic final ClassDescConstantDescs.CD_Longstatic final ClassDescConstantDescs.CD_Mapstatic final ClassDescConstantDescs.CD_MethodHandlestatic final ClassDescConstantDescs.CD_MethodHandleDescstatic final ClassDescConstantDescs.CD_MethodHandleDesc_Kindstatic final ClassDescConstantDescs.CD_MethodHandlesstatic final ClassDescConstantDescs.CD_MethodHandles_Lookupstatic final ClassDescConstantDescs.CD_MethodTypestatic final ClassDescConstantDescs.CD_MethodTypeDescstatic final ClassDescConstantDescs.CD_Numberstatic final ClassDescConstantDescs.CD_Objectstatic final ClassDescConstantDescs.CD_Setstatic final ClassDescConstantDescs.CD_shortプリミティブ・タイプshortを表すClassDescstatic final ClassDescConstantDescs.CD_Shortstatic final ClassDescConstantDescs.CD_Stringstatic final ClassDescConstantDescs.CD_Throwablestatic final ClassDescConstantDescs.CD_VarHandlestatic final ClassDescConstantDescs.CD_VarHandleDescstatic final ClassDescConstantDescs.CD_voidプリミティブ・タイプvoidを表すClassDescstatic final 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を指定します。static ClassDescClassDesc.ofInternalName(String name) "java/lang/String"などの内部形式のクラスまたはインタフェースの名前を指定して、クラスまたはインタフェース・タイプの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 MethodTypeDesc戻り型およびパラメータ型が指定されたMethodTypeDescを返します。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のメソッド・パラメータ型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を返します。