APIdia Launch Partner
Top Fields Constructors Methods
jdk.internal.classfile.impl

public final Class TemporaryConstantPool

extends Object
implements ConstantPoolBuilder
Class Inheritance
All Implemented Interfaces
java.lang.classfile.constantpool.ConstantPoolBuilder, java.lang.classfile.constantpool.ConstantPool, java.lang.Iterable
Imports
java.lang.classfile.BootstrapMethodEntry, java.lang.classfile.constantpool.*, java.lang.constant.MethodTypeDesc, java.util.List, .Objects

Field Summary

Modifier and TypeField and Description
public static final TemporaryConstantPool

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
bootstrapMethodCount()

Implements java.lang.classfile.constantpool.ConstantPool.bootstrapMethodCount.

Returns the number of entries in the bootstrap method table.

public BootstrapMethodEntry
bootstrapMethodEntry(int index)

Implements java.lang.classfile.constantpool.ConstantPool.bootstrapMethodEntry.

Returns the BootstrapMethodEntry at the specified index within the bootstrap method table.

public BootstrapMethodEntry
public boolean
canWriteDirect(ConstantPool constantPool)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.canWriteDirect.

Returns true if the index of any entry in the given constant pool refers to the same entry in this builder.

public ClassEntry
public ConstantDynamicEntry
public DoubleEntry
doubleEntry(double value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.doubleEntry.

Returns a DoubleEntry describing the provided value.

public PoolEntry
entryByIndex(int index)

Implements java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Returns the entry at the specified index.

public <T extends PoolEntry> T
entryByIndex(int index, Class<T> cls)

Implements java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Returns the entry of a given type at the specified index.

public FieldRefEntry
public FloatEntry
floatEntry(float value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.floatEntry.

Returns a FloatEntry describing the provided value.

public IntegerEntry
intEntry(int value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.intEntry.

Returns an IntegerEntry describing the provided value.

public InterfaceMethodRefEntry
public InvokeDynamicEntry
public LongEntry
longEntry(long value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.longEntry.

Returns a LongEntry describing the provided value.

public MethodHandleEntry
methodHandleEntry(int refKind, MemberRefEntry reference)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodHandleEntry.

Returns a MethodHandleEntry encoding a reference kind and referring to a MemberRefEntry.

public MethodRefEntry
public MethodTypeEntry
methodTypeEntry(MethodTypeDesc descriptor)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodTypeEntry.

Returns a MethodTypeEntry describing the same method type as the provided MethodTypeDesc.

public MethodTypeEntry
public ModuleEntry
public NameAndTypeEntry
nameAndTypeEntry(Utf8Entry nameEntry, Utf8Entry typeEntry)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.nameAndTypeEntry.

Returns a NameAndTypeEntry referring to the provided name and type Utf8Entry.

public PackageEntry
public int
size()

Implements java.lang.classfile.constantpool.ConstantPool.size.

Returns the exclusive upper bound of the valid indices of this constant pool.

public StringEntry
public Utf8Entry
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final TemporaryConstantPool INSTANCE

Constructor Detail

TemporaryConstantPoolback to summary
private TemporaryConstantPool()

Method Detail

bootstrapMethodCountback to summary
public int bootstrapMethodCount()

Implements java.lang.classfile.constantpool.ConstantPool.bootstrapMethodCount.

Doc from java.lang.classfile.constantpool.ConstantPool.bootstrapMethodCount.

Returns the number of entries in the bootstrap method table.

Annotations
@Override
bootstrapMethodEntryback to summary
public BootstrapMethodEntry bootstrapMethodEntry(int index)

Implements java.lang.classfile.constantpool.ConstantPool.bootstrapMethodEntry.

Doc from java.lang.classfile.constantpool.ConstantPool.bootstrapMethodEntry.

Returns the BootstrapMethodEntry at the specified index within the bootstrap method table.

Annotations
@Override
bsmEntryback to summary
public BootstrapMethodEntry bsmEntry(MethodHandleEntry methodReference, List<LoadableConstantEntry> arguments)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.bsmEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.bsmEntry.

Returns a BootstrapMethodEntry referring to a MethodHandleEntry and a list of LoadableConstantEntry. The MethodHandleEntry is the bootstrap method, and the list of LoadableConstantEntry is the arguments.

Annotations
@Override
canWriteDirectback to summary
public boolean canWriteDirect(ConstantPool constantPool)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.canWriteDirect.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.canWriteDirect.

Returns true if the index of any entry in the given constant pool refers to the same entry in this builder. This may be because they are the same builder, or because this builder was pre-populated from the given constant pool.

If the constant pool of an entry is not directly writable to this pool, it is alien to this pool, and a ClassFileBuilder associated with this constant pool will convert that alien constant pool entry.

Annotations
@Override
classEntryback to summary
public ClassEntry classEntry(Utf8Entry name)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.classEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.classEntry.

Returns a ClassEntry referring to the provided Utf8Entry. The Utf8Entry describes the internal form of the binary name of a class or interface or the field descriptor string of an array type.

Annotations
@Override
constantDynamicEntryback to summary
public ConstantDynamicEntry constantDynamicEntry(BootstrapMethodEntry bootstrapMethodEntry, NameAndTypeEntry nameAndType)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.constantDynamicEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.constantDynamicEntry.

Returns a ConstantDynamicEntry referring to a BootstrapMethodEntry and a NameAndTypeEntry. The BootstrapMethodEntry describes the bootstrap method and its invocation arguments in addition to the name and type, and the NameAndTypeEntry a name and a field descriptor.

Annotations
@Override
doubleEntryback to summary
public DoubleEntry doubleEntry(double value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.doubleEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.doubleEntry.

Returns a DoubleEntry describing the provided value.

All NaN values of the double may or may not be collapsed into a single "canonical" NaN value.

Annotations
@Override
entryByIndexback to summary
public PoolEntry entryByIndex(int index)

Implements java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Doc from java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Returns the entry at the specified index.

Annotations
@Override
entryByIndexback to summary
public <T extends PoolEntry> T entryByIndex(int index, Class<T> cls)

Implements java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Doc from java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Returns the entry of a given type at the specified index.

Annotations
@Override
fieldRefEntryback to summary
public FieldRefEntry fieldRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.fieldRefEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.fieldRefEntry.

Returns a FieldRefEntry referring to a ClassEntry and a NameAndTypeEntry. The ClassEntry describes a class or interface that has this field as a member, and the NameAndTypeEntry describes the unqualified name and the field descriptor for this field.

Annotations
@Override
floatEntryback to summary
public FloatEntry floatEntry(float value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.floatEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.floatEntry.

Returns a FloatEntry describing the provided value.

All NaN values of the float may or may not be collapsed into a single "canonical" NaN value.

Annotations
@Override
intEntryback to summary
public IntegerEntry intEntry(int value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.intEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.intEntry.

Returns an IntegerEntry describing the provided value.

Annotations
@Override
interfaceMethodRefEntryback to summary
public InterfaceMethodRefEntry interfaceMethodRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.interfaceMethodRefEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.interfaceMethodRefEntry.

Returns an InterfaceMethodRefEntry referring to a ClassEntry and a NameAndTypeEntry. The ClassEntry describes an interface that has this method as a member, and the NameAndTypeEntry describes the unqualified name and the method descriptor for this method.

Annotations
@Override
invokeDynamicEntryback to summary
public InvokeDynamicEntry invokeDynamicEntry(BootstrapMethodEntry bootstrapMethodEntry, NameAndTypeEntry nameAndType)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.invokeDynamicEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.invokeDynamicEntry.

Returns an InvokeDynamicEntry referring to a BootstrapMethodEntry and a NameAndTypeEntry. The BootstrapMethodEntry describes the bootstrap method and its invocation arguments in addition to the name and type, and the NameAndTypeEntry a name and a method descriptor.

Annotations
@Override
longEntryback to summary
public LongEntry longEntry(long value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.longEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.longEntry.

Returns a LongEntry describing the provided value.

Annotations
@Override
methodHandleEntryback to summary
public MethodHandleEntry methodHandleEntry(int refKind, MemberRefEntry reference)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodHandleEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.methodHandleEntry.

Returns a MethodHandleEntry encoding a reference kind and referring to a MemberRefEntry. The reference kind is in [1, 9], and the MemberRefEntry is subject to various restrictions based on the reference kind (JVMS 4.4.8).

Annotations
@Override
methodRefEntryback to summary
public MethodRefEntry methodRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodRefEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.methodRefEntry.

Returns a MethodRefEntry referring to a ClassEntry and a NameAndTypeEntry. The ClassEntry describes a class that has this method as a member, and the NameAndTypeEntry describes the unqualified name or the special name <init> and the method descriptor for this method.

Annotations
@Override
methodTypeEntryback to summary
public MethodTypeEntry methodTypeEntry(MethodTypeDesc descriptor)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodTypeEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.methodTypeEntry.

Returns a MethodTypeEntry describing the same method type as the provided MethodTypeDesc.

Annotations
@Override
methodTypeEntryback to summary
public MethodTypeEntry methodTypeEntry(Utf8Entry descriptor)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodTypeEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.methodTypeEntry.

Returns a MethodTypeEntry referring to a Utf8Entry. The Utf8Entry represents a method descriptor string.

Annotations
@Override
moduleEntryback to summary
public ModuleEntry moduleEntry(Utf8Entry name)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.moduleEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.moduleEntry.

Returns a ModuleEntry referring to the provided Utf8Entry. The Utf8Entry describes the module name.

Annotations
@Override
nameAndTypeEntryback to summary
public NameAndTypeEntry nameAndTypeEntry(Utf8Entry nameEntry, Utf8Entry typeEntry)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.nameAndTypeEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.nameAndTypeEntry.

Returns a NameAndTypeEntry referring to the provided name and type Utf8Entry. The name Utf8Entry describes an unqualified name or the special name <init>, and the type Utf8Entry describes a field or method descriptor string.

Annotations
@Override
packageEntryback to summary
public PackageEntry packageEntry(Utf8Entry name)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.packageEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.packageEntry.

Returns a PackageEntry referring to the provided Utf8Entry. The Utf8Entry describes the internal form of the name of a package.

Annotations
@Override
sizeback to summary
public int size()

Implements java.lang.classfile.constantpool.ConstantPool.size.

Doc from java.lang.classfile.constantpool.ConstantPool.size.

Returns the exclusive upper bound of the valid indices of this constant pool. The actual number of entries is lower because 0, size() are not valid, and a valid index may be unusable.

Annotations
@Override
stringEntryback to summary
public StringEntry stringEntry(Utf8Entry utf8)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.stringEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.stringEntry.

Returns a StringEntry referring to a Utf8Entry. The Utf8Entry describes the string value.

Annotations
@Override
utf8Entryback to summary
public Utf8Entry utf8Entry(String s)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.utf8Entry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.utf8Entry.

Returns a Utf8Entry describing the provided String.

Annotations
@Override