|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalt.jiapi.file.ConstantPool
public class ConstantPool
Class ConstantPool.
Nested Class Summary | |
---|---|
class |
ConstantPool.ClassInfo
Represents a CONSTANT_Class_info in constant pool |
class |
ConstantPool.DoubleInfo
|
class |
ConstantPool.Entry
Base class for entries in ConstantPool. |
class |
ConstantPool.FieldRefInfo
Represents a CONSTANT_FieldRef in constant pool |
class |
ConstantPool.FloatInfo
|
class |
ConstantPool.IntegerInfo
|
class |
ConstantPool.InterfaceMethodRefInfo
Represents a CONSTANT_InterfaceMethodRef in constant pool |
class |
ConstantPool.LongInfo
|
class |
ConstantPool.MethodRefInfo
Represents a CONSTANT_MethodRef in constant pool |
class |
ConstantPool.NameAndTypeInfo
Represents a CONSTANT_NameAndType in constant pool |
class |
ConstantPool.NullEntry
|
class |
ConstantPool.StringInfo
|
class |
ConstantPool.Utf8Info
|
Field Summary | |
---|---|
static byte |
CONSTANT_Class
Constant, that represents a class_ref tag in constant pool |
static byte |
CONSTANT_Double
Constant, that represents a double tag in constant pool |
static byte |
CONSTANT_Fieldref
Constant, that represents a field_ref tag in constant pool |
static byte |
CONSTANT_Float
Constant, that represents a float tag in constant pool |
static byte |
CONSTANT_Integer
Constant, that represents a integer tag in constant pool |
static byte |
CONSTANT_InterfaceMethodref
Constant, that represents a interfacemethod_ref tag in constant pool |
static byte |
CONSTANT_Long
Constant, that represents a long tag in constant pool |
static byte |
CONSTANT_Methodref
Constant, that represents a method_ref tag in constant pool |
static byte |
CONSTANT_NameAndType
Constant, that represents a nameAndType tag in constant pool |
static byte |
CONSTANT_String
Constant, that represents a string tag in constant pool |
static byte |
CONSTANT_Utf8
Constant, that represents a Utf8 tag in constant pool |
Constructor Summary | |
---|---|
ConstantPool()
Creates an empty constant pool. |
Method Summary | |
---|---|
short |
add(ConstantPool.Entry entry)
Adds an entry to this constant pool. |
ConstantPool.ClassInfo |
addClassInfo(java.lang.String className)
Adds a new ClassInfo. |
ConstantPool.DoubleInfo |
addDoubleInfo(int highBytes,
int lowBytes)
Adds a new DoubleInfo. |
ConstantPool.FieldRefInfo |
addFieldRefInfo(ConstantPool.ClassInfo ci,
java.lang.String name,
java.lang.String desc)
Adds a new FieldRefInfo. |
ConstantPool.FloatInfo |
addFloatInfo(int bytes)
Adds a new FloatInfo. |
ConstantPool.IntegerInfo |
addIntegerInfo(int bytes)
Adds a new IntegerInfo. |
ConstantPool.InterfaceMethodRefInfo |
addInterfaceMethodRefInfo(ConstantPool.ClassInfo ci,
java.lang.String name,
java.lang.String desc)
Adds a new InterfaceMethodRefInfo. |
ConstantPool.LongInfo |
addLongInfo(int highBytes,
int lowBytes)
Adds a new LongInfo. |
ConstantPool.MethodRefInfo |
addMethodRefInfo(ConstantPool.ClassInfo ci,
java.lang.String name,
java.lang.String desc)
Adds a new MethodRefInfo. |
ConstantPool.NameAndTypeInfo |
addNameAndTypeInfo(java.lang.String name,
java.lang.String descriptor)
Adds a new NameAndTypeInfo. |
ConstantPool.StringInfo |
addStringInfo(java.lang.String s)
Adds a new StringInfo. |
ConstantPool.Utf8Info |
addUtf8Info(java.lang.String s)
Adds a new Utf8Info. |
ConstantPool.Entry |
get(int index)
Gets an entry from constant pool. |
java.lang.String |
getClassName(short index)
Index must point to a Class_info structure in Constant pool |
java.lang.String |
getStringValue(short index)
Gets a String at given constant pool index. |
java.lang.String |
getUtf8(short index)
Gets a String at given constant pool index. |
int |
size()
Get the size of this ConstantPool. |
byte[] |
toBytes()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte CONSTANT_Class
public static final byte CONSTANT_Double
public static final byte CONSTANT_Fieldref
public static final byte CONSTANT_Float
public static final byte CONSTANT_Integer
public static final byte CONSTANT_InterfaceMethodref
public static final byte CONSTANT_Long
public static final byte CONSTANT_Methodref
public static final byte CONSTANT_NameAndType
public static final byte CONSTANT_String
public static final byte CONSTANT_Utf8
Constructor Detail |
---|
public ConstantPool()
Method Detail |
---|
public short add(ConstantPool.Entry entry)
public ConstantPool.ClassInfo addClassInfo(java.lang.String className)
className
- a fully qualified class name
public ConstantPool.DoubleInfo addDoubleInfo(int highBytes, int lowBytes)
highBytes
- double constantlowBytes
- double constant
public ConstantPool.FieldRefInfo addFieldRefInfo(ConstantPool.ClassInfo ci, java.lang.String name, java.lang.String desc)
ci
- ClassInfo, that is supposed to contain created field
referencename
- Name of the fielddesc
- descriptor of the field
public ConstantPool.FloatInfo addFloatInfo(int bytes)
bytes
- float constant
public ConstantPool.IntegerInfo addIntegerInfo(int bytes)
bytes
- integer constant
public ConstantPool.InterfaceMethodRefInfo addInterfaceMethodRefInfo(ConstantPool.ClassInfo ci, java.lang.String name, java.lang.String desc)
ci
- ClassInfo, that is supposed to contain created interface
method referencename
- Name of the methoddesc
- descriptor of the method
public ConstantPool.LongInfo addLongInfo(int highBytes, int lowBytes)
highBytes
- long constantlowBytes
- long constant
public ConstantPool.MethodRefInfo addMethodRefInfo(ConstantPool.ClassInfo ci, java.lang.String name, java.lang.String desc)
ci
- ClassInfo, that is supposed to contain created method
referencename
- Name of the methoddesc
- descriptor of the method
public ConstantPool.NameAndTypeInfo addNameAndTypeInfo(java.lang.String name, java.lang.String descriptor)
name
- Name to adddescriptor
- descriptor to add
public ConstantPool.StringInfo addStringInfo(java.lang.String s)
s
- String constant to add
public ConstantPool.Utf8Info addUtf8Info(java.lang.String s)
s
- String to add
public ConstantPool.Entry get(int index)
index
- index into constant pool
public java.lang.String getClassName(short index)
index
- index to ClassInfo in constant pool.
java.lang.IllegalArgumentException
- is throw, if entry at
given index does not point into ClassInfo, or
ClassInfo.getNameIndex() does not point to Utf8Infopublic java.lang.String getStringValue(short index)
index
- index into constant pool
java.lang.IllegalArgumentException
- is throw, if entry at
given index does not point into StringInfo or utf8Infopublic java.lang.String getUtf8(short index)
index
- index into constant pool
java.lang.IllegalArgumentException
- is throw, if entry at
given index does not point into Utf8Infopublic int size()
public byte[] toBytes()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |