java.lang.Object
org.glavo.classfile.impl.SplitConstantPool
- All Implemented Interfaces:
Iterable<PoolEntry>,ClassFileElement,ConstantPool,ConstantPoolBuilder,WritableElement<ConstantPool>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of entries in the bootstrap method table.bootstrapMethodEntry(int index) Returns theBootstrapMethodEntryat the specified index within the bootstrap method table.bsmEntry(MethodHandleEntry methodReference, List<LoadableConstantEntry> arguments) Returns aBootstrapMethodEntrydescribing the provided bootstrap method and static arguments.booleancanWriteDirect(ConstantPool other) Returns whether the provided constant pool is index-compatible with this one.classEntry(Utf8Entry nameEntry) Returns AClassEntrydescribing the class whose internal name is encoded in the provided Utf8Entry.constantDynamicEntry(BootstrapMethodEntry bootstrapMethodEntry, NameAndTypeEntry nameAndType) Returns AConstantDynamicEntrydescribing a dynamic constant.doubleEntry(double value) Returns ADoubleEntrydescribing the provided value.entryByIndex(int index) Returns the entry at the specified index.fieldRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType) Returns AFieldRefEntrydescribing a field of a class.floatEntry(float value) Returns AFloatEntrydescribing the provided value.intEntry(int value) Returns AnIntegerEntrydescribing the provided value.interfaceMethodRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType) Returns AInterfaceMethodRefEntrydescribing a method of a class.invokeDynamicEntry(BootstrapMethodEntry bootstrapMethodEntry, NameAndTypeEntry nameAndType) Returns AnInvokeDynamicEntrydescribing a dynamic call site.longEntry(long value) Returns ALongEntrydescribing the provided value.methodHandleEntry(int refKind, MemberRefEntry reference) Returns AMethodHandleEntrydescribing a field accessor or method.methodRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType) Returns AMethodRefEntrydescribing a method of a class.methodTypeEntry(MethodTypeDesc descriptor) Returns AMethodTypeEntrydescribing a method type.methodTypeEntry(Utf8Entry descriptor) Returns AMethodTypeEntrydescribing a method type.moduleEntry(Utf8Entry nameEntry) Returns AModuleEntrydescribing the module whose name is encoded in the provided Utf8Entry.nameAndTypeEntry(Utf8Entry nameEntry, Utf8Entry typeEntry) Returns ANameAndTypeEntrydescribing the provided name and type.packageEntry(Utf8Entry nameEntry) Returns APackageEntrydescribing the class whose internal name is encoded in the provided Utf8Entry.intsize()Returns the size of the constant pool.stringEntry(Utf8Entry utf8) Returns AStringEntryreferencing the provided UTF8 entry.booleanWrites associated bootstrap method entries to the specified writervoidWrites the element to the specified writerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.glavo.classfile.constantpool.ConstantPool
iteratorMethods inherited from interface org.glavo.classfile.constantpool.ConstantPoolBuilder
annotationConstantValueEntry, bsmEntry, classEntry, constantDynamicEntry, constantValueEntry, fieldRefEntry, interfaceMethodRefEntry, invokeDynamicEntry, loadableConstantEntry, methodHandleEntry, methodRefEntry, moduleEntry, nameAndTypeEntry, nameAndTypeEntry, packageEntry, stringEntry, utf8Entry, utf8EntryMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SplitConstantPool
public SplitConstantPool() -
SplitConstantPool
-
-
Method Details
-
size
public int size()Description copied from interface:ConstantPoolReturns the size of the constant pool.- Specified by:
sizein interfaceConstantPool- Returns:
- the size of the constant pool
-
bootstrapMethodCount
public int bootstrapMethodCount()Description copied from interface:ConstantPoolReturns the number of entries in the bootstrap method table.- Specified by:
bootstrapMethodCountin interfaceConstantPool- Returns:
- the number of entries in the bootstrap method table
-
entryByIndex
Description copied from interface:ConstantPoolReturns the entry at the specified index.- Specified by:
entryByIndexin interfaceConstantPool- Parameters:
index- the index within the pool of the desired entry- Returns:
- the entry at the specified index
-
bootstrapMethodEntry
Description copied from interface:ConstantPoolReturns theBootstrapMethodEntryat the specified index within the bootstrap method table.- Specified by:
bootstrapMethodEntryin interfaceConstantPool- Parameters:
index- the index within the bootstrap method table of the desired entry- Returns:
- the
BootstrapMethodEntryat the specified index within the bootstrap method table
-
canWriteDirect
Description copied from interface:ConstantPoolBuilderReturns whether the provided constant pool is index-compatible with this one. This may be because they are the same constant pool, or because this constant pool was copied from the other.- Specified by:
canWriteDirectin interfaceConstantPoolBuilder- Parameters:
other- the other constant pool- Returns:
- whether the provided constant pool is index-compatible with this one
-
writeBootstrapMethods
Description copied from interface:ConstantPoolBuilderWrites associated bootstrap method entries to the specified writer- Specified by:
writeBootstrapMethodsin interfaceConstantPoolBuilder- Parameters:
buf- the writer- Returns:
- false when no bootstrap method entry has been written
-
writeTo
Description copied from interface:WritableElementWrites the element to the specified writer- Specified by:
writeToin interfaceWritableElement<ConstantPool>- Parameters:
buf- the writer
-
utf8Entry
Description copied from interface:ConstantPoolBuilderReturns AUtf8Entrydescribing the provided String. If a UTF8 entry in the pool already describes this string, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
utf8Entryin interfaceConstantPoolBuilder- Parameters:
s- the string- Returns:
- A
Utf8Entrydescribing the provided String
-
classEntry
Description copied from interface:ConstantPoolBuilderReturns AClassEntrydescribing the class whose internal name is encoded in the provided Utf8Entry. If a Class entry in the pool already describes this class, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
classEntryin interfaceConstantPoolBuilder- Parameters:
nameEntry- the constant pool entry describing the internal name of the class- Returns:
- A
ClassEntrydescribing the class whose internal name is encoded in the provided Utf8Entry
-
packageEntry
Description copied from interface:ConstantPoolBuilderReturns APackageEntrydescribing the class whose internal name is encoded in the provided Utf8Entry. If a Package entry in the pool already describes this class, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
packageEntryin interfaceConstantPoolBuilder- Parameters:
nameEntry- the constant pool entry describing the internal name of the package- Returns:
- A
PackageEntrydescribing the class whose internal name is encoded in the provided Utf8Entry
-
moduleEntry
Description copied from interface:ConstantPoolBuilderReturns AModuleEntrydescribing the module whose name is encoded in the provided Utf8Entry. If a module entry in the pool already describes this class, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
moduleEntryin interfaceConstantPoolBuilder- Parameters:
nameEntry- the constant pool entry describing the module name- Returns:
- A
ModuleEntrydescribing the module whose name is encoded in the provided Utf8Entry
-
nameAndTypeEntry
public AbstractPoolEntry.NameAndTypeEntryImpl nameAndTypeEntry(Utf8Entry nameEntry, Utf8Entry typeEntry) Description copied from interface:ConstantPoolBuilderReturns ANameAndTypeEntrydescribing the provided name and type. If a NameAndType entry in the pool already describes this name and type, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
nameAndTypeEntryin interfaceConstantPoolBuilder- Parameters:
nameEntry- the member nametypeEntry- the member field or method descriptor- Returns:
- A
NameAndTypeEntrydescribing the provided name and type
-
fieldRefEntry
Description copied from interface:ConstantPoolBuilderReturns AFieldRefEntrydescribing a field of a class. If a FieldRef entry in the pool already describes this field, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
fieldRefEntryin interfaceConstantPoolBuilder- Parameters:
owner- the class the field is a member ofnameAndType- the name and type of the field- Returns:
- A
FieldRefEntrydescribing a field of a class
-
methodRefEntry
Description copied from interface:ConstantPoolBuilderReturns AMethodRefEntrydescribing a method of a class. If a MethodRefEntry entry in the pool already describes this method, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
methodRefEntryin interfaceConstantPoolBuilder- Parameters:
owner- the class the method is a member ofnameAndType- the name and type of the method- Returns:
- A
MethodRefEntrydescribing a method of a class
-
interfaceMethodRefEntry
public InterfaceMethodRefEntry interfaceMethodRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType) Description copied from interface:ConstantPoolBuilderReturns AInterfaceMethodRefEntrydescribing a method of a class. If a InterfaceMethodRefEntry entry in the pool already describes this method, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
interfaceMethodRefEntryin interfaceConstantPoolBuilder- Parameters:
owner- the class the method is a member ofnameAndType- the name and type of the method- Returns:
- A
InterfaceMethodRefEntrydescribing a method of a class
-
methodTypeEntry
Description copied from interface:ConstantPoolBuilderReturns AMethodTypeEntrydescribing a method type. If a MethodType entry in the pool already describes this method type, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
methodTypeEntryin interfaceConstantPoolBuilder- Parameters:
descriptor- the symbolic descriptor of the method type- Returns:
- A
MethodTypeEntrydescribing a method type
-
methodTypeEntry
Description copied from interface:ConstantPoolBuilderReturns AMethodTypeEntrydescribing a method type. If a MethodType entry in the pool already describes this method type, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
methodTypeEntryin interfaceConstantPoolBuilder- Parameters:
descriptor- the constant pool entry for the method type descriptor- Returns:
- A
MethodTypeEntrydescribing a method type
-
methodHandleEntry
Description copied from interface:ConstantPoolBuilderReturns AMethodHandleEntrydescribing a field accessor or method. If a MethodHandle entry in the pool already describes this method handle, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
methodHandleEntryin interfaceConstantPoolBuilder- Parameters:
refKind- the reference kind of the method handlereference- the constant pool entry describing the field or method- Returns:
- A
MethodHandleEntrydescribing a field accessor or method
-
invokeDynamicEntry
public InvokeDynamicEntry invokeDynamicEntry(BootstrapMethodEntry bootstrapMethodEntry, NameAndTypeEntry nameAndType) Description copied from interface:ConstantPoolBuilderReturns AnInvokeDynamicEntrydescribing a dynamic call site. If an InvokeDynamic entry in the pool already describes this site, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
invokeDynamicEntryin interfaceConstantPoolBuilder- Parameters:
bootstrapMethodEntry- the entry in the bootstrap method tablenameAndType- the invocation name and type- Returns:
- An
InvokeDynamicEntrydescribing a dynamic call site
-
constantDynamicEntry
public ConstantDynamicEntry constantDynamicEntry(BootstrapMethodEntry bootstrapMethodEntry, NameAndTypeEntry nameAndType) Description copied from interface:ConstantPoolBuilderReturns AConstantDynamicEntrydescribing a dynamic constant. If a ConstantDynamic entry in the pool already describes this site, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
constantDynamicEntryin interfaceConstantPoolBuilder- Parameters:
bootstrapMethodEntry- the entry in the bootstrap method tablenameAndType- the invocation name and type- Returns:
- A
ConstantDynamicEntrydescribing a dynamic constant
-
intEntry
Description copied from interface:ConstantPoolBuilderReturns AnIntegerEntrydescribing the provided value. If an integer entry in the pool already describes this value, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
intEntryin interfaceConstantPoolBuilder- Parameters:
value- the value- Returns:
- An
IntegerEntrydescribing the provided value
-
floatEntry
Description copied from interface:ConstantPoolBuilderReturns AFloatEntrydescribing the provided value. If a float entry in the pool already describes this value, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
floatEntryin interfaceConstantPoolBuilder- Parameters:
value- the value- Returns:
- A
FloatEntrydescribing the provided value
-
longEntry
Description copied from interface:ConstantPoolBuilderReturns ALongEntrydescribing the provided value. If a long entry in the pool already describes this value, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
longEntryin interfaceConstantPoolBuilder- Parameters:
value- the value- Returns:
- A
LongEntrydescribing the provided value
-
doubleEntry
Description copied from interface:ConstantPoolBuilderReturns ADoubleEntrydescribing the provided value. If a double entry in the pool already describes this value, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
doubleEntryin interfaceConstantPoolBuilder- Parameters:
value- the value- Returns:
- A
DoubleEntrydescribing the provided value
-
stringEntry
Description copied from interface:ConstantPoolBuilderReturns AStringEntryreferencing the provided UTF8 entry. If a String entry in the pool already describes this value, it is returned; otherwise, a new entry is added and the new entry is returned.- Specified by:
stringEntryin interfaceConstantPoolBuilder- Parameters:
utf8- the UTF8 entry describing the string- Returns:
- A
StringEntryreferencing the provided UTF8 entry
-
bsmEntry
public BootstrapMethodEntry bsmEntry(MethodHandleEntry methodReference, List<LoadableConstantEntry> arguments) Description copied from interface:ConstantPoolBuilderReturns aBootstrapMethodEntrydescribing the provided bootstrap method and static arguments.- Specified by:
bsmEntryin interfaceConstantPoolBuilder- Parameters:
methodReference- the bootstrap methodarguments- the bootstrap arguments- Returns:
- a
BootstrapMethodEntrydescribing the provided bootstrap method and static arguments
-