com.sun.tools.classfile
Class ConstantPool

java.lang.Object
  extended by com.sun.tools.classfile.ConstantPool

public class ConstantPool
extends java.lang.Object

See JVMS3, section 4.5.

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.


Nested Class Summary
static class ConstantPool.CONSTANT_Class_info
           
static class ConstantPool.CONSTANT_Double_info
           
static class ConstantPool.CONSTANT_Fieldref_info
           
static class ConstantPool.CONSTANT_Float_info
           
static class ConstantPool.CONSTANT_Integer_info
           
static class ConstantPool.CONSTANT_InterfaceMethodref_info
           
static class ConstantPool.CONSTANT_Long_info
           
static class ConstantPool.CONSTANT_Methodref_info
           
static class ConstantPool.CONSTANT_NameAndType_info
           
static class ConstantPool.CONSTANT_String_info
           
static class ConstantPool.CONSTANT_Utf8_info
           
static class ConstantPool.CPInfo
           
static class ConstantPool.CPRefInfo
           
 class ConstantPool.EntryNotFound
           
 class ConstantPool.InvalidEntry
           
 class ConstantPool.InvalidIndex
           
 class ConstantPool.UnexpectedEntry
           
static interface ConstantPool.Visitor<R,P>
           
 
Field Summary
static int CONSTANT_Class
           
static int CONSTANT_Double
           
static int CONSTANT_Fieldref
           
static int CONSTANT_Float
           
static int CONSTANT_Integer
           
static int CONSTANT_InterfaceMethodref
           
static int CONSTANT_Long
           
static int CONSTANT_Methodref
           
static int CONSTANT_NameAndType
           
static int CONSTANT_String
           
static int CONSTANT_Utf8
           
private  ConstantPool.CPInfo[] pool
           
 
Constructor Summary
ConstantPool(ClassReader cr)
           
ConstantPool(ConstantPool.CPInfo[] pool)
           
 
Method Summary
 ConstantPool.CPInfo get(int index)
           
private  ConstantPool.CPInfo get(int index, int expected_type)
           
 ConstantPool.CONSTANT_Class_info getClassInfo(int index)
           
 ConstantPool.CONSTANT_NameAndType_info getNameAndTypeInfo(int index)
           
 int getUTF8Index(java.lang.String value)
           
 ConstantPool.CONSTANT_Utf8_info getUTF8Info(int index)
           
 java.lang.String getUTF8Value(int index)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSTANT_Utf8

public static final int CONSTANT_Utf8
See Also:
Constant Field Values

CONSTANT_Integer

public static final int CONSTANT_Integer
See Also:
Constant Field Values

CONSTANT_Float

public static final int CONSTANT_Float
See Also:
Constant Field Values

CONSTANT_Long

public static final int CONSTANT_Long
See Also:
Constant Field Values

CONSTANT_Double

public static final int CONSTANT_Double
See Also:
Constant Field Values

CONSTANT_Class

public static final int CONSTANT_Class
See Also:
Constant Field Values

CONSTANT_String

public static final int CONSTANT_String
See Also:
Constant Field Values

CONSTANT_Fieldref

public static final int CONSTANT_Fieldref
See Also:
Constant Field Values

CONSTANT_Methodref

public static final int CONSTANT_Methodref
See Also:
Constant Field Values

CONSTANT_InterfaceMethodref

public static final int CONSTANT_InterfaceMethodref
See Also:
Constant Field Values

CONSTANT_NameAndType

public static final int CONSTANT_NameAndType
See Also:
Constant Field Values

pool

private ConstantPool.CPInfo[] pool
Constructor Detail

ConstantPool

ConstantPool(ClassReader cr)
       throws java.io.IOException,
              ConstantPool.InvalidEntry
Throws:
java.io.IOException
ConstantPool.InvalidEntry

ConstantPool

public ConstantPool(ConstantPool.CPInfo[] pool)
Method Detail

size

public int size()

get

public ConstantPool.CPInfo get(int index)
                        throws ConstantPool.InvalidIndex
Throws:
ConstantPool.InvalidIndex

get

private ConstantPool.CPInfo get(int index,
                                int expected_type)
                         throws ConstantPool.InvalidIndex,
                                ConstantPool.UnexpectedEntry
Throws:
ConstantPool.InvalidIndex
ConstantPool.UnexpectedEntry

getUTF8Info

public ConstantPool.CONSTANT_Utf8_info getUTF8Info(int index)
                                            throws ConstantPool.InvalidIndex,
                                                   ConstantPool.UnexpectedEntry
Throws:
ConstantPool.InvalidIndex
ConstantPool.UnexpectedEntry

getClassInfo

public ConstantPool.CONSTANT_Class_info getClassInfo(int index)
                                              throws ConstantPool.InvalidIndex,
                                                     ConstantPool.UnexpectedEntry
Throws:
ConstantPool.InvalidIndex
ConstantPool.UnexpectedEntry

getNameAndTypeInfo

public ConstantPool.CONSTANT_NameAndType_info getNameAndTypeInfo(int index)
                                                          throws ConstantPool.InvalidIndex,
                                                                 ConstantPool.UnexpectedEntry
Throws:
ConstantPool.InvalidIndex
ConstantPool.UnexpectedEntry

getUTF8Value

public java.lang.String getUTF8Value(int index)
                              throws ConstantPool.InvalidIndex,
                                     ConstantPool.UnexpectedEntry
Throws:
ConstantPool.InvalidIndex
ConstantPool.UnexpectedEntry

getUTF8Index

public int getUTF8Index(java.lang.String value)
                 throws ConstantPool.EntryNotFound
Throws:
ConstantPool.EntryNotFound