public class ConstantPool extends Object implements ClassFileConstants, TypeIds
AccAbstract, AccAnnotation, AccAnnotationDefault, AccBridge, AccDefault, AccDeprecated, AccEnum, AccFinal, AccInterface, AccNative, AccPrivate, AccProtected, AccPublic, AccStatic, AccStrictfp, AccSuper, AccSynchronized, AccSynthetic, AccTransient, AccVarargs, AccVolatile, ATTR_LINES, ATTR_SOURCE, ATTR_STACK_MAP, ATTR_STACK_MAP_TABLE, ATTR_VARS, BOOLEAN_ARRAY, BYTE_ARRAY, CHAR_ARRAY, ClassTag, CLDC_1_1, ConstantClassFixedSize, ConstantDoubleFixedSize, ConstantFieldRefFixedSize, ConstantFloatFixedSize, ConstantIntegerFixedSize, ConstantInterfaceMethodRefFixedSize, ConstantInvokeDynamicFixedSize, ConstantLongFixedSize, ConstantMethodHandleFixedSize, ConstantMethodRefFixedSize, ConstantMethodTypeFixedSize, ConstantNameAndTypeFixedSize, ConstantStringFixedSize, ConstantUtf8FixedSize, DOUBLE_ARRAY, DoubleTag, FieldRefTag, FLOAT_ARRAY, FloatTag, INT_ARRAY, IntegerTag, InterfaceMethodRefTag, InvokeDynamicTag, JDK_DEFERRED, JDK1_1, JDK1_2, JDK1_3, JDK1_4, JDK1_5, JDK1_6, JDK1_7, JDK1_8, LONG_ARRAY, LongTag, MAJOR_VERSION_1_1, MAJOR_VERSION_1_2, MAJOR_VERSION_1_3, MAJOR_VERSION_1_4, MAJOR_VERSION_1_5, MAJOR_VERSION_1_6, MAJOR_VERSION_1_7, MAJOR_VERSION_1_8, MethodHandleTag, MethodRefTag, MethodTypeTag, MINOR_VERSION_0, MINOR_VERSION_1, MINOR_VERSION_2, MINOR_VERSION_3, MINOR_VERSION_4, NameAndTypeTag, SHORT_ARRAY, StringTag, Utf8TagBitAutoCloseable, BitCloseable, BitResourceFreeCloseable, BitUninitialized, BitWrapperCloseable, Boolean2Boolean, Boolean2Int, Boolean2String, BOXING, Byte2Byte, Byte2Char, Byte2Double, Byte2Float, Byte2Int, Byte2Long, Byte2Short, Byte2String, Char2Byte, Char2Char, Char2Double, Char2Float, Char2Int, Char2Long, Char2Short, Char2String, COMPILE_TYPE_MASK, Double2Byte, Double2Char, Double2Double, Double2Float, Double2Int, Double2Long, Double2Short, Double2String, Float2Byte, Float2Char, Float2Double, Float2Float, Float2Int, Float2Long, Float2Short, Float2String, IMPLICIT_CONVERSION_MASK, InheritableBits, Int2Byte, Int2Char, Int2Double, Int2Float, Int2Int, Int2Long, Int2Short, Int2String, Long2Byte, Long2Char, Long2Double, Long2Float, Long2Int, Long2Long, Long2Short, Long2String, NoId, Null2Null, Null2String, Object2boolean, Object2byte, Object2char, Object2double, Object2float, Object2int, Object2long, Object2Object, Object2short, Object2String, Short2Byte, Short2Char, Short2Double, Short2Float, Short2Int, Short2Long, Short2Short, Short2String, String2String, T_boolean, T_byte, T_char, T_ComGoogleCommonBasePreconditions, T_ComGoogleInjectInject, T_ConfiguredAnnotationNonNull, T_ConfiguredAnnotationNonNullByDefault, T_ConfiguredAnnotationNullable, T_double, T_float, T_int, T_JavaIoException, T_JavaIoExternalizable, T_JavaIoObjectStreamException, T_JavaIoPrintStream, T_JavaIoSerializable, T_JavaLangAnnotationAnnotation, T_JavaLangAnnotationDocumented, T_JavaLangAnnotationElementType, T_JavaLangAnnotationInherited, T_JavaLangAnnotationRetention, T_JavaLangAnnotationRetentionPolicy, T_JavaLangAnnotationTarget, T_JavaLangAssertionError, T_JavaLangAutoCloseable, T_JavaLangBoolean, T_JavaLangByte, T_JavaLangCharacter, T_JavaLangClass, T_JavaLangClassNotFoundException, T_JavaLangCloneable, T_JavaLangDeprecated, T_JavaLangDouble, T_JavaLangEnum, T_JavaLangError, T_JavaLangException, T_JavaLangFloat, T_JavaLangIllegalArgumentException, T_JavaLangInteger, T_JavaLangInvokeMethodHandlePolymorphicSignature, T_JavaLangIterable, T_JavaLangLong, T_JavaLangNoClassDefError, T_JavaLangObject, T_JavaLangOverride, T_JavaLangReflectConstructor, T_JavaLangReflectField, T_JavaLangReflectMethod, T_JavaLangRuntimeException, T_JavaLangSafeVarargs, T_JavaLangShort, T_JavaLangString, T_JavaLangStringBuffer, T_JavaLangStringBuilder, T_JavaLangSuppressWarnings, T_JavaLangSystem, T_JavaLangThrowable, T_JavaLangVoid, T_JavaUtilCollection, T_JavaUtilIterator, T_JavaUtilObjects, T_JavaxInjectInject, T_JunitFrameworkAssert, T_long, T_null, T_OrgApacheCommonsLang3Validate, T_OrgApacheCommonsLangValidate, T_OrgEclipseCoreRuntimeAssert, T_OrgJunitAssert, T_short, T_undefined, T_void, UNBOXING| Constructor and Description |
|---|
ConstantPool(ClassFile classFile)
ConstantPool constructor comment.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
dumpBytes()
Return the content of the receiver
|
void |
initialize(ClassFile givenClassFile) |
int |
literalIndex(byte[] utf8encoding,
char[] stringCharArray) |
int |
literalIndex(char[] utf8Constant)
This method returns the index into the constantPool corresponding to the type descriptor.
|
int |
literalIndex(char[] stringCharArray,
byte[] utf8encoding) |
int |
literalIndex(double key)
This method returns the index into the constantPool corresponding to the double
value.
|
int |
literalIndex(float key)
This method returns the index into the constantPool corresponding to the float
value.
|
int |
literalIndex(int key)
This method returns the index into the constantPool corresponding to the int
value.
|
int |
literalIndex(long key)
This method returns the index into the constantPool corresponding to the long
value.
|
int |
literalIndex(String stringConstant)
This method returns the index into the constantPool corresponding to the type descriptor.
|
int |
literalIndex(TypeBinding binding) |
int |
literalIndexForField(char[] declaringClass,
char[] name,
char[] signature) |
int |
literalIndexForLdc(char[] stringCharArray)
This method returns the index into the constantPool corresponding to the type descriptor.
|
int |
literalIndexForMethod(char[] declaringClass,
char[] selector,
char[] signature,
boolean isInterface) |
int |
literalIndexForMethod(TypeBinding declaringClass,
char[] selector,
char[] signature,
boolean isInterface) |
int |
literalIndexForNameAndType(char[] name,
char[] signature) |
int |
literalIndexForType(char[] constantPoolName) |
int |
literalIndexForType(TypeBinding binding) |
void |
reset() |
void |
resetForAttributeName(char[] attributeName,
int constantPoolIndex,
int constantPoolOffset) |
void |
resetForClinit(int constantPoolIndex,
int constantPoolOffset)
This method is used to clean the receiver in case of a clinit header is generated, but the
clinit has no code.
|
protected void |
writeU1(int value)
Write a unsigned byte into the byte array
|
protected void |
writeU2(int value)
Write a unsigned byte into the byte array
|
public static final int DOUBLE_INITIAL_SIZE
public static final int FLOAT_INITIAL_SIZE
public static final int INT_INITIAL_SIZE
public static final int LONG_INITIAL_SIZE
public static final int UTF8_INITIAL_SIZE
public static final int STRING_INITIAL_SIZE
public static final int METHODS_AND_FIELDS_INITIAL_SIZE
public static final int CLASS_INITIAL_SIZE
public static final int NAMEANDTYPE_INITIAL_SIZE
public static final int CONSTANTPOOL_INITIAL_SIZE
public static final int CONSTANTPOOL_GROW_SIZE
protected DoubleCache doubleCache
protected FloatCache floatCache
protected IntegerCache intCache
protected LongCache longCache
public CharArrayCache UTF8Cache
protected CharArrayCache stringCache
protected HashtableOfObject methodsAndFieldsCache
protected CharArrayCache classCache
protected HashtableOfObject nameAndTypeCacheForFieldsAndMethods
public byte[] poolContent
public int currentIndex
public int currentOffset
public int[] offsets
public ClassFile classFile
public static final char[] Append
public static final char[] ARRAY_NEWINSTANCE_NAME
public static final char[] ARRAY_NEWINSTANCE_SIGNATURE
public static final char[] ArrayCopy
public static final char[] ArrayCopySignature
public static final char[] ArrayJavaLangClassConstantPoolName
public static final char[] ArrayJavaLangObjectConstantPoolName
public static final char[] booleanBooleanSignature
public static final char[] BooleanConstrSignature
public static final char[] BOOLEANVALUE_BOOLEAN_METHOD_NAME
public static final char[] BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE
public static final char[] byteByteSignature
public static final char[] ByteConstrSignature
public static final char[] BYTEVALUE_BYTE_METHOD_NAME
public static final char[] BYTEVALUE_BYTE_METHOD_SIGNATURE
public static final char[] charCharacterSignature
public static final char[] CharConstrSignature
public static final char[] CHARVALUE_CHARACTER_METHOD_NAME
public static final char[] CHARVALUE_CHARACTER_METHOD_SIGNATURE
public static final char[] Clinit
public static final char[] DefaultConstructorSignature
public static final char[] ClinitSignature
public static final char[] Close
public static final char[] CloseSignature
public static final char[] DesiredAssertionStatus
public static final char[] DesiredAssertionStatusSignature
public static final char[] DoubleConstrSignature
public static final char[] doubleDoubleSignature
public static final char[] DOUBLEVALUE_DOUBLE_METHOD_NAME
public static final char[] DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE
public static final char[] Exit
public static final char[] ExitIntSignature
public static final char[] FloatConstrSignature
public static final char[] floatFloatSignature
public static final char[] FLOATVALUE_FLOAT_METHOD_NAME
public static final char[] FLOATVALUE_FLOAT_METHOD_SIGNATURE
public static final char[] ForName
public static final char[] ForNameSignature
public static final char[] GET_BOOLEAN_METHOD_NAME
public static final char[] GET_BOOLEAN_METHOD_SIGNATURE
public static final char[] GET_BYTE_METHOD_NAME
public static final char[] GET_BYTE_METHOD_SIGNATURE
public static final char[] GET_CHAR_METHOD_NAME
public static final char[] GET_CHAR_METHOD_SIGNATURE
public static final char[] GET_DOUBLE_METHOD_NAME
public static final char[] GET_DOUBLE_METHOD_SIGNATURE
public static final char[] GET_FLOAT_METHOD_NAME
public static final char[] GET_FLOAT_METHOD_SIGNATURE
public static final char[] GET_INT_METHOD_NAME
public static final char[] GET_INT_METHOD_SIGNATURE
public static final char[] GET_LONG_METHOD_NAME
public static final char[] GET_LONG_METHOD_SIGNATURE
public static final char[] GET_OBJECT_METHOD_NAME
public static final char[] GET_OBJECT_METHOD_SIGNATURE
public static final char[] GET_SHORT_METHOD_NAME
public static final char[] GET_SHORT_METHOD_SIGNATURE
public static final char[] GetClass
public static final char[] GetClassSignature
public static final char[] GetComponentType
public static final char[] GetComponentTypeSignature
public static final char[] GetConstructor
public static final char[] GetConstructorSignature
public static final char[] GETDECLAREDCONSTRUCTOR_NAME
public static final char[] GETDECLAREDCONSTRUCTOR_SIGNATURE
public static final char[] GETDECLAREDFIELD_NAME
public static final char[] GETDECLAREDFIELD_SIGNATURE
public static final char[] GETDECLAREDMETHOD_NAME
public static final char[] GETDECLAREDMETHOD_SIGNATURE
public static final char[] GetMessage
public static final char[] GetMessageSignature
public static final char[] HasNext
public static final char[] HasNextSignature
public static final char[] Init
public static final char[] IntConstrSignature
public static final char[] ITERATOR_NAME
public static final char[] ITERATOR_SIGNATURE
public static final char[] Intern
public static final char[] InternSignature
public static final char[] IntIntegerSignature
public static final char[] INTVALUE_INTEGER_METHOD_NAME
public static final char[] INTVALUE_INTEGER_METHOD_SIGNATURE
public static final char[] INVOKE_METHOD_METHOD_NAME
public static final char[] INVOKE_METHOD_METHOD_SIGNATURE
public static final char[][] JAVA_LANG_REFLECT_ACCESSIBLEOBJECT
public static final char[][] JAVA_LANG_REFLECT_ARRAY
public static final char[] JavaIoPrintStreamSignature
public static final char[] JavaLangAssertionErrorConstantPoolName
public static final char[] JavaLangBooleanConstantPoolName
public static final char[] JavaLangByteConstantPoolName
public static final char[] JavaLangCharacterConstantPoolName
public static final char[] JavaLangClassConstantPoolName
public static final char[] JavaLangClassNotFoundExceptionConstantPoolName
public static final char[] JavaLangClassSignature
public static final char[] JavaLangDoubleConstantPoolName
public static final char[] JavaLangEnumConstantPoolName
public static final char[] JavaLangErrorConstantPoolName
public static final char[] JavaLangExceptionConstantPoolName
public static final char[] JavaLangFloatConstantPoolName
public static final char[] JavaLangIntegerConstantPoolName
public static final char[] JavaLangLongConstantPoolName
public static final char[] JavaLangNoClassDefFoundErrorConstantPoolName
public static final char[] JavaLangNoSuchFieldErrorConstantPoolName
public static final char[] JavaLangObjectConstantPoolName
public static final char[] JAVALANGREFLECTACCESSIBLEOBJECT_CONSTANTPOOLNAME
public static final char[] JAVALANGREFLECTARRAY_CONSTANTPOOLNAME
public static final char[] JavaLangReflectConstructorConstantPoolName
public static final char[] JavaLangReflectConstructorNewInstanceSignature
public static final char[] JAVALANGREFLECTFIELD_CONSTANTPOOLNAME
public static final char[] JAVALANGREFLECTMETHOD_CONSTANTPOOLNAME
public static final char[] JavaLangShortConstantPoolName
public static final char[] JavaLangStringBufferConstantPoolName
public static final char[] JavaLangStringBuilderConstantPoolName
public static final char[] JavaLangStringConstantPoolName
public static final char[] JavaLangStringSignature
public static final char[] JavaLangObjectSignature
public static final char[] JavaLangSystemConstantPoolName
public static final char[] JavaLangThrowableConstantPoolName
public static final char[] JavaLangVoidConstantPoolName
public static final char[] JavaUtilIteratorConstantPoolName
public static final char[] LongConstrSignature
public static final char[] longLongSignature
public static final char[] LONGVALUE_LONG_METHOD_NAME
public static final char[] LONGVALUE_LONG_METHOD_SIGNATURE
public static final char[] NewInstance
public static final char[] NewInstanceSignature
public static final char[] Next
public static final char[] NextSignature
public static final char[] ObjectConstrSignature
public static final char[] ObjectSignature
public static final char[] Ordinal
public static final char[] OrdinalSignature
public static final char[] Out
public static final char[] SET_BOOLEAN_METHOD_NAME
public static final char[] SET_BOOLEAN_METHOD_SIGNATURE
public static final char[] SET_BYTE_METHOD_NAME
public static final char[] SET_BYTE_METHOD_SIGNATURE
public static final char[] SET_CHAR_METHOD_NAME
public static final char[] SET_CHAR_METHOD_SIGNATURE
public static final char[] SET_DOUBLE_METHOD_NAME
public static final char[] SET_DOUBLE_METHOD_SIGNATURE
public static final char[] SET_FLOAT_METHOD_NAME
public static final char[] SET_FLOAT_METHOD_SIGNATURE
public static final char[] SET_INT_METHOD_NAME
public static final char[] SET_INT_METHOD_SIGNATURE
public static final char[] SET_LONG_METHOD_NAME
public static final char[] SET_LONG_METHOD_SIGNATURE
public static final char[] SET_OBJECT_METHOD_NAME
public static final char[] SET_OBJECT_METHOD_SIGNATURE
public static final char[] SET_SHORT_METHOD_NAME
public static final char[] SET_SHORT_METHOD_SIGNATURE
public static final char[] SETACCESSIBLE_NAME
public static final char[] SETACCESSIBLE_SIGNATURE
public static final char[] ShortConstrSignature
public static final char[] shortShortSignature
public static final char[] SHORTVALUE_SHORT_METHOD_NAME
public static final char[] SHORTVALUE_SHORT_METHOD_SIGNATURE
public static final char[] StringBufferAppendBooleanSignature
public static final char[] StringBufferAppendCharSignature
public static final char[] StringBufferAppendDoubleSignature
public static final char[] StringBufferAppendFloatSignature
public static final char[] StringBufferAppendIntSignature
public static final char[] StringBufferAppendLongSignature
public static final char[] StringBufferAppendObjectSignature
public static final char[] StringBufferAppendStringSignature
public static final char[] StringBuilderAppendBooleanSignature
public static final char[] StringBuilderAppendCharSignature
public static final char[] StringBuilderAppendDoubleSignature
public static final char[] StringBuilderAppendFloatSignature
public static final char[] StringBuilderAppendIntSignature
public static final char[] StringBuilderAppendLongSignature
public static final char[] StringBuilderAppendObjectSignature
public static final char[] StringBuilderAppendStringSignature
public static final char[] StringConstructorSignature
public static final char[] This
public static final char[] ToString
public static final char[] ToStringSignature
public static final char[] TYPE
public static final char[] ValueOf
public static final char[] ValueOfBooleanSignature
public static final char[] ValueOfCharSignature
public static final char[] ValueOfDoubleSignature
public static final char[] ValueOfFloatSignature
public static final char[] ValueOfIntSignature
public static final char[] ValueOfLongSignature
public static final char[] ValueOfObjectSignature
public static final char[] ValueOfStringClassSignature
public static final char[] JAVA_LANG_ANNOTATION_DOCUMENTED
public static final char[] JAVA_LANG_ANNOTATION_ELEMENTTYPE
public static final char[] JAVA_LANG_ANNOTATION_RETENTION
public static final char[] JAVA_LANG_ANNOTATION_RETENTIONPOLICY
public static final char[] JAVA_LANG_ANNOTATION_TARGET
public static final char[] JAVA_LANG_DEPRECATED
public static final char[] JAVA_LANG_ANNOTATION_INHERITED
public static final char[] JAVA_LANG_SAFEVARARGS
public static final char[] JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE
public static final char[] HashCode
public static final char[] HashCodeSignature
public static final char[] Equals
public static final char[] EqualsSignature
public static final char[] AddSuppressed
public static final char[] AddSuppressedSignature
public ConstantPool(ClassFile classFile)
public void initialize(ClassFile givenClassFile)
public byte[] dumpBytes()
public int literalIndex(byte[] utf8encoding,
char[] stringCharArray)
public int literalIndex(TypeBinding binding)
public int literalIndex(char[] utf8Constant)
utf8Constant - char[]intpublic int literalIndex(char[] stringCharArray,
byte[] utf8encoding)
public int literalIndex(double key)
key - doubleintpublic int literalIndex(float key)
key - floatintpublic int literalIndex(int key)
key - intintpublic int literalIndex(long key)
key - longintpublic int literalIndex(String stringConstant)
stringConstant - java.lang.Stringintpublic int literalIndexForType(char[] constantPoolName)
public int literalIndexForType(TypeBinding binding)
public int literalIndexForMethod(char[] declaringClass,
char[] selector,
char[] signature,
boolean isInterface)
public int literalIndexForMethod(TypeBinding declaringClass, char[] selector, char[] signature, boolean isInterface)
public int literalIndexForNameAndType(char[] name,
char[] signature)
public int literalIndexForField(char[] declaringClass,
char[] name,
char[] signature)
public int literalIndexForLdc(char[] stringCharArray)
stringCharArray - char[]intpublic void resetForClinit(int constantPoolIndex,
int constantPoolOffset)
TypeDeclaration.addClinit()protected final void writeU1(int value)
value - int The value to write into the byte arrayprotected final void writeU2(int value)
value - int The value to write into the byte arraypublic void reset()
public void resetForAttributeName(char[] attributeName,
int constantPoolIndex,
int constantPoolOffset)
Copyright © 2013. All rights reserved.