Class ConstPool
- java.lang.Object
-
- org.jboss.classfilewriter.constpool.ConstPool
-
- All Implemented Interfaces:
WritableEntry
public class ConstPool extends java.lang.Object implements WritableEntry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classConstPool.MemberInfoprivate static classConstPool.NameAndType
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.Integer>classLocationsprivate java.lang.IntegerconstPoolSizeThe constant_pool_count field of the class file formatprivate intcountprivate java.util.Map<java.lang.Double,java.lang.Integer>doubleLocationsprivate java.util.LinkedHashMap<java.lang.Integer,ConstPoolEntry>entriesprivate java.util.Map<ConstPool.MemberInfo,java.lang.Integer>fieldLocationsprivate java.util.Map<java.lang.Float,java.lang.Integer>floatLocationsprivate java.util.Map<java.lang.Integer,java.lang.Integer>integerLocationsprivate java.util.Map<ConstPool.MemberInfo,java.lang.Integer>interfaceMethodLocationsprivate java.util.Map<java.lang.Long,java.lang.Integer>longLocationsprivate java.util.Map<ConstPool.MemberInfo,java.lang.Integer>methodLocationsprivate java.util.Map<ConstPool.NameAndType,java.lang.Integer>nameAndTypeLocationsprivate java.util.Map<java.lang.String,java.lang.Integer>stringLocationsprivate java.util.Map<java.lang.String,java.lang.Integer>utf8Locations
-
Constructor Summary
Constructors Constructor Description ConstPool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.IntegeraddClassEntry(java.lang.String className)Adds a CONSTANT_Class_info to the const pool.java.lang.IntegeraddDoubleEntry(double entry)java.lang.IntegeraddFieldEntry(java.lang.String className, java.lang.String fieldName, java.lang.String fieldType)java.lang.IntegeraddFloatEntry(float entry)java.lang.IntegeraddIntegerEntry(int entry)java.lang.IntegeraddInterfaceMethodEntry(java.lang.String className, java.lang.String methodName, java.lang.String descriptor)java.lang.IntegeraddLongEntry(long entry)java.lang.IntegeraddMethodEntry(java.lang.String className, java.lang.String methodName, java.lang.String descriptor)java.lang.IntegeraddNameAndTypeEntry(java.lang.String name, java.lang.String type)java.lang.IntegeraddStringEntry(java.lang.String string)Adds a CONSTANT_String_info to the const pool.java.lang.IntegeraddUtf8Entry(java.lang.String entry)voidwrite(ByteArrayDataOutputStream stream)
-
-
-
Field Detail
-
entries
private final java.util.LinkedHashMap<java.lang.Integer,ConstPoolEntry> entries
-
utf8Locations
private final java.util.Map<java.lang.String,java.lang.Integer> utf8Locations
-
classLocations
private final java.util.Map<java.lang.String,java.lang.Integer> classLocations
-
stringLocations
private final java.util.Map<java.lang.String,java.lang.Integer> stringLocations
-
nameAndTypeLocations
private final java.util.Map<ConstPool.NameAndType,java.lang.Integer> nameAndTypeLocations
-
fieldLocations
private final java.util.Map<ConstPool.MemberInfo,java.lang.Integer> fieldLocations
-
methodLocations
private final java.util.Map<ConstPool.MemberInfo,java.lang.Integer> methodLocations
-
interfaceMethodLocations
private final java.util.Map<ConstPool.MemberInfo,java.lang.Integer> interfaceMethodLocations
-
integerLocations
private final java.util.Map<java.lang.Integer,java.lang.Integer> integerLocations
-
floatLocations
private final java.util.Map<java.lang.Float,java.lang.Integer> floatLocations
-
longLocations
private final java.util.Map<java.lang.Long,java.lang.Integer> longLocations
-
doubleLocations
private final java.util.Map<java.lang.Double,java.lang.Integer> doubleLocations
-
count
private int count
-
constPoolSize
private java.lang.Integer constPoolSize
The constant_pool_count field of the class file format
-
-
Method Detail
-
addUtf8Entry
public java.lang.Integer addUtf8Entry(java.lang.String entry)
-
addClassEntry
public java.lang.Integer addClassEntry(java.lang.String className)
Adds a CONSTANT_Class_info to the const pool. This must be in internal form
-
addStringEntry
public java.lang.Integer addStringEntry(java.lang.String string)
Adds a CONSTANT_String_info to the const pool.
-
addIntegerEntry
public java.lang.Integer addIntegerEntry(int entry)
-
addFloatEntry
public java.lang.Integer addFloatEntry(float entry)
-
addLongEntry
public java.lang.Integer addLongEntry(long entry)
-
addDoubleEntry
public java.lang.Integer addDoubleEntry(double entry)
-
addNameAndTypeEntry
public java.lang.Integer addNameAndTypeEntry(java.lang.String name, java.lang.String type)
-
addFieldEntry
public java.lang.Integer addFieldEntry(java.lang.String className, java.lang.String fieldName, java.lang.String fieldType)
-
addMethodEntry
public java.lang.Integer addMethodEntry(java.lang.String className, java.lang.String methodName, java.lang.String descriptor)
-
addInterfaceMethodEntry
public java.lang.Integer addInterfaceMethodEntry(java.lang.String className, java.lang.String methodName, java.lang.String descriptor)
-
write
public void write(ByteArrayDataOutputStream stream) throws java.io.IOException
- Specified by:
writein interfaceWritableEntry- Throws:
java.io.IOException
-
-