|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--jreversepro.reflect.JConstantPool
JConstantPool represents the abstraction of the ConstantPool.
| Field Summary | |
static int |
PTR_INVALID
PTR_INVALID of a pointer of a ConstantPool tag means that they are not applicable for that ConstantPool tag. |
static java.lang.String |
STR_INVALID
STR_INVALID corresponds to an invalid entry in the ConstantPool. |
static int |
TAG_CLASS
TAG_CLASS corresponds to CONSTANT_CLASS |
static int |
TAG_DOUBLE
TAG_DOUBLE corresponds to CONSTANT_DOUBLE |
static int |
TAG_FIELDREF
TAG_FIELDREF corresponds to CONSTANT_FIELDREF |
static int |
TAG_FLOAT
TAG_FLOAT corresponds to CONSTANT_FLOAT |
static int |
TAG_INTEGER
TAG_INTEGER corresponds to CONSTANT_INTEGER |
static int |
TAG_INTERFACEREF
TAG_INTERFACEREF corresponds to CONSTANT_INTERFACEREF |
static int |
TAG_LONG
TAG_LONG corresponds to CONSTANT_LONG |
static int |
TAG_METHODREF
TAG_METHODREF corresponds to CONSTANT_METHODREF |
static int |
TAG_NAMETYPE
TAG_NAMETYPE corresponds to CONSTANT_NAMETYPE |
static int |
TAG_NOTHING
TAG_NOTHING means that the ConstantPool Entry is invalid. |
static int |
TAG_STRING
TAG_STRING corresponds to CONSTANT_STRING |
static int |
TAG_UTF8
TAG_UTF8 corresponds to CONSTANT_UTF8 |
| Fields inherited from interface jreversepro.common.KeyWords |
ANY, BOOLEAN, BREAK, BYTE, CASE, CHAR, CLASS, CLASS_STRING, CLINIT, CLOSE_BRACKET, COND_AND, COND_NOT, COND_OR, CONTINUE, DEFAULT, DEFAULT_PACKAGE, DOUBLE, EQUALTO, FALSE, FLOAT, FOREIGN_CLASS, FOREIGN_OBJ, GOTO, INIT, INSTANCEOF, INT, INTERFACE, JVM_BOOLEAN, JVM_CHAR, JVM_VOID, LANG_OBJECT, LENGTH, LONG, NEW, NULL, OPEN_BRACKET, OPR_EQ, OPR_GE, OPR_GT, OPR_LE, OPR_LT, OPR_NE, OPR_NOT, REFERENCE, RET_ADDR, RETURN, SHORT, SPACE, STATIC, SUPER, SWITCH, THIS, THISCLASS, THROW, TRUE, VOID |
| Constructor Summary | |
JConstantPool(int cpMax)
Constructor. |
|
| Method Summary | |
void |
addClassEntry(int classIndex)
Adds a new TAG_CLASS entry to the constantpool. |
void |
addDoubleEntry(java.lang.String value)
Adds a new TAG_DOUBLE entry to the constantpool. |
void |
addFieldRefEntry(int ptr1,
int ptr2)
Adds a new TAG_FIELDREF entry to the constantpool. |
void |
addFloatEntry(java.lang.String value)
Adds a new TAG_FLOAT entry to the constantpool. |
void |
addIntegerEntry(java.lang.String value)
Adds a new TAG_INTEGER entry to the constantpool. |
void |
addInterfaceRefEntry(int ptr1,
int ptr2)
Adds a new TAG_INTERFACEREF entry to the constantpool. |
void |
addLongEntry(java.lang.String value)
Adds a new TAG_LONG entry to the constantpool. |
void |
addMethodRefEntry(int ptr1,
int ptr2)
Adds a new TAG_METHODREF entry to the constantpool. |
void |
addNameTypeEntry(int ptr1,
int ptr2)
Adds a new TAG_NAMETYPE entry to the constantpool. |
void |
addNullEntry()
Adds a NULL entry to the ConstantPool. |
void |
addStringEntry(int stringIndex)
Adds a new TAG_STRING entry to the constantpool. |
void |
addUtf8Entry(java.lang.String value)
Adds a new TAG_UTF8 entry to the constantpool. |
java.lang.String |
getBasicDataTypeValue(int index)
Returns the value for the ConstantPool Entries according to their types. |
java.lang.String |
getClassName(int index)
Given an index to TAG_CLASS this returns the class name pointed to by it. |
java.lang.String |
getCpValue(int index)
Returns the ConstantPool value. |
java.lang.String |
getDataType(int index)
Returns the data type of the given ConstantPool Index. |
java.util.List |
getEntries()
Returns the constantpool entries. |
java.lang.String |
getEntryInfo()
Returns the whole ConstantPool info in a formatter manner. |
java.lang.String |
getEntryInfo(int cpIndex)
Returns the name pointed to by this JConstantPoolEntry. |
java.lang.String |
getFieldName(int index)
Given an index to TAG_NAMETYPE this returns the name of the member ( field / method ) |
java.lang.String |
getFieldType(int index)
Given an index to TAG_NAMETYPE this returns the type of the member ( field / method ) |
java.lang.String |
getFirstDirectName(int index)
Returns the Utf8 value pointed by the first pointer of the index to the ConstantPool. |
JImport |
getImportedClasses()
The constantpool is the one and only source that contains the references to external types. |
java.lang.String |
getLdcString(int index)
Given an Cp index this returns the proper constant pool value depending on the tag type. |
int |
getMaxCpEntry()
Returns the number of ConstantPool Entries. |
java.lang.String |
getName(JConstantPoolEntry ent)
Returns the name pointed to by this JConstantPoolEntry. |
int |
getPtr1(int index)
Returns the first pointer of the ConstantPool Data. |
int |
getPtr2(int index)
Returns the second pointer of the ConstantPool Data. |
java.lang.String |
getSecondDirectName(int index)
Returns the Utf8 value pointed by the II pointer of the index to the ConstantPool. |
int |
getTagByte(int index)
Returns the tagbyte of the ConstantPool. |
java.lang.String |
getTagDescriptor(int index)
Describes the tag in brief. |
static java.lang.String |
getTagName(int tagByte)
Returns the actual name of the tag . |
java.lang.String |
getType(JConstantPoolEntry ent)
Returns the type pointed to by this JConstantPoolEntry. |
java.lang.String |
getUtf8String(int index)
Given an index to TAG_UTF8 this returns the string value. |
boolean |
isTagDouble(int index)
Returns if the given index to the ConstantPool is TAG_DOUBLE or not. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String STR_INVALID
public static final int PTR_INVALID
public static final int TAG_NOTHING
public static final int TAG_UTF8
public static final int TAG_INTEGER
public static final int TAG_FLOAT
public static final int TAG_LONG
public static final int TAG_DOUBLE
public static final int TAG_CLASS
public static final int TAG_STRING
public static final int TAG_FIELDREF
public static final int TAG_METHODREF
public static final int TAG_INTERFACEREF
public static final int TAG_NAMETYPE
| Constructor Detail |
public JConstantPool(int cpMax)
cpMax - Maximum size of the ConstantPool.| Method Detail |
public int getMaxCpEntry()
public java.util.List getEntries()
public void addFieldRefEntry(int ptr1,
int ptr2)
ptr1 - Pointer to TAG_CLASSptr2 - Pointer to TAG_NAMETYPE
public void addMethodRefEntry(int ptr1,
int ptr2)
ptr1 - Pointer to TAG_CLASSptr2 - Pointer to TAG_NAMETYPE
public void addInterfaceRefEntry(int ptr1,
int ptr2)
ptr1 - Pointer to TAG_CLASSptr2 - Pointer to TAG_NAMETYPE
public void addNameTypeEntry(int ptr1,
int ptr2)
ptr1 - Pointer to TAG_UTF8ptr2 - Pointer to TAG_UTF8public void addNullEntry()
public void addUtf8Entry(java.lang.String value)
value - Value of the UTF8 String.public void addIntegerEntry(java.lang.String value)
value - Value of the integer.public void addFloatEntry(java.lang.String value)
value - Value of the float number.public void addDoubleEntry(java.lang.String value)
value - Value of the double.public void addLongEntry(java.lang.String value)
value - Value of the Long.public void addClassEntry(int classIndex)
classIndex - Index to UTF8 string containing
class name.public void addStringEntry(int stringIndex)
stringIndex - Index to the UTF8 string
containing the stringvalue.public java.lang.String getDataType(int index)
index - Index to the ConstantPool Entry.
public boolean isTagDouble(int index)
index - Index to ConstantPool
public int getPtr1(int index)
index - Index to ConstantPool
public int getPtr2(int index)
index - Index to ConstantPool
public int getTagByte(int index)
index - Index to ConstantPool
public java.lang.String getCpValue(int index)
index - Index to ConstantPool
public java.lang.String getFirstDirectName(int index)
index - Index to ConstantPool
public java.lang.String getSecondDirectName(int index)
index - Index to ConstantPool
public java.lang.String getClassName(int index)
index - Index to ConstantPool
public java.lang.String getFieldName(int index)
index - Index to ConstantPool
public java.lang.String getFieldType(int index)
index - Index to ConstantPool
public java.lang.String getUtf8String(int index)
index - Index to ConstantPool
public java.lang.String getLdcString(int index)
throws ClassParserException
index - Index to ConstantPool
ClassParserException - Thrown in case of an wrong
constantpool index being referrred.public JImport getImportedClasses()
public java.lang.String getBasicDataTypeValue(int index)
throws ClassParserException
index - Index to ConstantPool
ClassParserException - Throws in case the referred
constantpool index does not represent a basic data type index.public static java.lang.String getTagName(int tagByte)
tagByte - Tag Byte value
public java.lang.String getTagDescriptor(int index)
throws ClassParserException
index - Index to the ConstantPool.
ClassParserException - Thrown in case of an invalid
constantpool reference.public java.lang.String getName(JConstantPoolEntry ent)
ent - Constant Pool Entry
public java.lang.String getType(JConstantPoolEntry ent)
ent - Constant Pool Entry
public java.lang.String getEntryInfo()
public java.lang.String getEntryInfo(int cpIndex)
cpIndex - Index to Constant Pool
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||