APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.constant

public final Class PrimitiveClassDescImpl

extends DynamicConstantDesc<Class<?>>
implements ClassDesc
Class Inheritance
All Implemented Interfaces
java.lang.constant.ClassDesc, java.lang.invoke.TypeDescriptor.OfField, java.lang.invoke.TypeDescriptor, java.lang.constant.ConstantDesc
Annotations
@AOTSafeClassInitializer
Imports
java.lang.constant.ClassDesc, .ConstantDescs, .DynamicConstantDesc, java.lang.invoke.MethodHandles, jdk.internal.vm.annotation.AOTSafeClassInitializer, .Stable, sun.invoke.util.Wrapper

A nominal descriptor for the class constant corresponding to a primitive type (e.g., int.class).

Field Summary

Modifier and TypeField and Description
public static final PrimitiveClassDescImpl
CD_boolean

ClassDesc representing the primitive type boolean

public static final PrimitiveClassDescImpl
CD_byte

ClassDesc representing the primitive type byte

public static final PrimitiveClassDescImpl
CD_char

ClassDesc representing the primitive type char

public static final PrimitiveClassDescImpl
CD_double

ClassDesc representing the primitive type double

public static final PrimitiveClassDescImpl
CD_float

ClassDesc representing the primitive type float

public static final PrimitiveClassDescImpl
CD_int

ClassDesc representing the primitive type int

public static final PrimitiveClassDescImpl
CD_long

ClassDesc representing the primitive type long

public static final PrimitiveClassDescImpl
CD_short

ClassDesc representing the primitive type short

public static final PrimitiveClassDescImpl
CD_void

ClassDesc representing the primitive type void

private final String
private Wrapper

Constructor Summary

AccessConstructor and Description
private
PrimitiveClassDescImpl(String
the descriptor string, which must be a one-character string corresponding to one of the nine base types
descriptor
)

Creates a ClassDesc given a descriptor string for a primitive type.

Method Summary

Modifier and TypeMethod and Description
public ClassDesc
arrayType(int rank)

Implements java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type of the specified rank, whose component type is described by this ClassDesc.

public ClassDesc
arrayType()

Implements java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type whose component type is described by this ClassDesc.

public String
descriptorString()

Implements java.lang.constant.ClassDesc.descriptorString.

Returns a field type descriptor string for this type

public String
displayName()

Implements java.lang.constant.ClassDesc.displayName.

Returns a human-readable name for this ClassDesc.

public boolean
isPrimitive()

Overrides default java.lang.constant.ClassDesc.isPrimitive.

Returns whether this ClassDesc describes a primitive type.

public Class<?>
resolveConstantDesc(MethodHandles.Lookup lookup)

Overrides java.lang.constant.DynamicConstantDesc.resolveConstantDesc.

Implements java.lang.constant.ClassDesc.resolveConstantDesc, java.lang.constant.ConstantDesc.resolveConstantDesc.

Resolves this descriptor reflectively, emulating the resolution behavior of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4.

public String
toString()

Overrides java.lang.constant.DynamicConstantDesc.toString.

Returns a compact textual description of this constant description, including the bootstrap method, the constant name and type, and the static bootstrap arguments.

public Wrapper
Inherited from java.lang.constant.DynamicConstantDesc:
bootstrapArgsbootstrapArgsListbootstrapMethodconstantNameconstantTypeequalshashCodeofofofCanonicalofNamed

Field Detail

CD_booleanback to summary
public static final PrimitiveClassDescImpl CD_boolean

ClassDesc representing the primitive type boolean

CD_byteback to summary
public static final PrimitiveClassDescImpl CD_byte

ClassDesc representing the primitive type byte

CD_charback to summary
public static final PrimitiveClassDescImpl CD_char

ClassDesc representing the primitive type char

CD_doubleback to summary
public static final PrimitiveClassDescImpl CD_double

ClassDesc representing the primitive type double

CD_floatback to summary
public static final PrimitiveClassDescImpl CD_float

ClassDesc representing the primitive type float

CD_intback to summary
public static final PrimitiveClassDescImpl CD_int

ClassDesc representing the primitive type int

CD_longback to summary
public static final PrimitiveClassDescImpl CD_long

ClassDesc representing the primitive type long

CD_shortback to summary
public static final PrimitiveClassDescImpl CD_short

ClassDesc representing the primitive type short

CD_voidback to summary
public static final PrimitiveClassDescImpl CD_void

ClassDesc representing the primitive type void

descriptorback to summary
private final String descriptor
lazyWrapperback to summary
private Wrapper lazyWrapper
Annotations
@Stable

Constructor Detail

PrimitiveClassDescImplback to summary
private PrimitiveClassDescImpl(String descriptor)

Creates a ClassDesc given a descriptor string for a primitive type.

Parameters
descriptor:String

the descriptor string, which must be a one-character string corresponding to one of the nine base types

Exceptions
IllegalArgumentException:
if the descriptor string does not describe a valid primitive type
Java Virtual Machine Specification
4.3 Descriptors

Method Detail

arrayTypeback to summary
public ClassDesc arrayType(int rank)

Implements java.lang.constant.ClassDesc.arrayType.

Doc from java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type of the specified rank, whose component type is described by this ClassDesc.

Annotations
@Override
arrayTypeback to summary
public ClassDesc arrayType()

Implements java.lang.constant.ClassDesc.arrayType.

Doc from java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type whose component type is described by this ClassDesc.

Annotations
@Override
descriptorStringback to summary
public String descriptorString()

Implements java.lang.constant.ClassDesc.descriptorString.

Doc from java.lang.constant.ClassDesc.descriptorString.

Returns a field type descriptor string for this type

Annotations
@Override
displayNameback to summary
public String displayName()

Implements java.lang.constant.ClassDesc.displayName.

Doc from java.lang.constant.ClassDesc.displayName.

Returns a human-readable name for this ClassDesc. For primitive types, this method returns the simple name (such as int). For class or interface types, this method returns the unqualified class name. For array types, this method returns the human-readable name of the component type suffixed with the appropriate number of [] pairs.

Annotations
@Override
isPrimitiveback to summary
public boolean isPrimitive()

Overrides default java.lang.constant.ClassDesc.isPrimitive.

Doc from java.lang.constant.ClassDesc.isPrimitive.

Returns whether this ClassDesc describes a primitive type.

Annotations
@Override
resolveConstantDescback to summary
public Class<?> resolveConstantDesc(MethodHandles.Lookup lookup)

Overrides java.lang.constant.DynamicConstantDesc.resolveConstantDesc.

Implements java.lang.constant.ClassDesc.resolveConstantDesc, java.lang.constant.ConstantDesc.resolveConstantDesc.

Doc from java.lang.constant.ConstantDesc.resolveConstantDesc.

Resolves this descriptor reflectively, emulating the resolution behavior of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4. The resolution and access control context is provided by the MethodHandles.Lookup parameter. No caching of the resulting value is performed.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.constant.DynamicConstantDesc.toString.

Doc from java.lang.constant.DynamicConstantDesc.toString.

Returns a compact textual description of this constant description, including the bootstrap method, the constant name and type, and the static bootstrap arguments.

Annotations
@Override
wrapperback to summary
public Wrapper wrapper()