インタフェースjava.lang.constant.ClassDescの
使用
| パッケージ | 説明 |
|---|---|
| java.lang |
Javaプログラミング言語の設計にあたり基本的なクラスを提供します。
|
| java.lang.constant |
クラスやメソッド・ハンドルなどのランタイム・エンティティ用に「名目記述子」を表すクラスおよびインタフェース、および定数プール・エントリや
invokedynamicコール・サイトなどのクラス・ファイル・エンティティ用に「名目記述子」を表すクラスおよびインタフェース。 |
| java.lang.invoke |
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を返します。ClassDescDynamicConstantDesc. constantType()この定数に対してLDCのNameAndTypeオペランドに表示される型を示すClassDescを返します。default ClassDescClassDesc. nested(String nestedName)default ClassDescClassDesc. nested(String firstNestedName, String... moreNestedNames)static ClassDescClassDesc. of(String name)クラスまたはインタフェース型に対して、"java.lang.String"などのクラスまたはインタフェースの名前を指定してClassDescを返します。static ClassDescClassDesc. of(String packageName, String className)クラスまたはインタフェース・タイプに対してClassDescを返します。クラスまたはインタフェースのパッケージ名および未修飾(simple)名が指定されます。static ClassDescClassDesc. ofDescriptor(String descriptor)クラス、インタフェース、配列またはプリミティブ・タイプの記述子文字列に対してClassDescを指定します。ClassDescDirectMethodHandleDesc. owner()この名目記述子で説明するメソッドまたはフィールドを宣言するClassDescを返します。ClassDesc[]MethodTypeDesc. parameterArray()配列としてパラメータ型を返します。ClassDescMethodTypeDesc. parameterType(int index)このMethodTypeDescで説明するメソッド・タイプのindex番目のパラメータのパラメータ・タイプを返します。ClassDescMethodTypeDesc. returnType()MethodTypeDescで記述されたメソッド・タイプの戻り型を取得します。型ClassDescの引数を持つ型を返すjava.lang.constantのメソッド 修飾子と型 メソッド 説明 List<ClassDesc>MethodTypeDesc. parameterList()不変のListとしてパラメータ型を返します。型ClassDescのパラメータを持つjava.lang.constantのメソッド 修飾子と型 メソッド 説明 MethodTypeDescMethodTypeDesc. changeParameterType(int index, ClassDesc paramType)このタイプと同一のMethodTypeDescを返します。ただし、指定されたタイプに変更されたパラメータ・タイプは1つのみです。MethodTypeDescMethodTypeDesc. changeReturnType(ClassDesc returnType)指定された戻り型を除き、これと同一のMethodTypeDescを返します。MethodTypeDescMethodTypeDesc. insertParameterTypes(int pos, ClassDesc... paramTypes)このパラメータ・タイプが追加されたことを除き、同じMethodTypeDescを返します。static DirectMethodHandleDescMethodHandleDesc. of(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String name, String lookupDescriptor)宣言されたメソッドの呼出し、コンストラクタの呼出し、またはフィールドへのアクセスに対応するMethodHandleDescを作成します。static MethodTypeDescMethodTypeDesc. of(ClassDesc returnDesc, ClassDesc... paramDescs)戻り型およびパラメータ型が指定された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のコンストラクタ コンストラクタ 説明 DynamicConstantDesc(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc... bootstrapArgs)動的定数の名目記述子を作成します。 -
java.lang.invokeでのClassDescの使用
ClassDescを戻すjava.lang.invokeのメソッド 修飾子と型 メソッド 説明 ClassDescVarHandle.VarHandleDesc. varType()この記述子で説明されている変数の型をClassDescで記述します。型ClassDescのパラメータを持つjava.lang.invokeのメソッド 修飾子と型 メソッド 説明 static VarHandle.VarHandleDescVarHandle.VarHandleDesc. ofArray(ClassDesc arrayClass)配列型のVarHandleに対応するVarHandle.VarHandleDescを返します。static VarHandle.VarHandleDescVarHandle.VarHandleDesc. ofField(ClassDesc declaringClass, String name, ClassDesc fieldType)インスタンス・フィールドについて、VarHandleに対応するVarHandle.VarHandleDescを返します。static VarHandle.VarHandleDescVarHandle.VarHandleDesc. ofStaticField(ClassDesc declaringClass, String name, ClassDesc fieldType)静的フィールドについてVarHandleに対応するVarHandle.VarHandleDescを返します。