Save This Page
Home » openjdk-7 » sun » misc » [javadoc | source]
sun.misc
static class: ProxyGenerator.ConstantPool [javadoc | source]
java.lang.Object
   sun.misc.ProxyGenerator$ConstantPool
A ConstantPool object represents the constant pool of a class file being generated. This representation of a constant pool is designed specifically for use by ProxyGenerator; in particular, it assumes that constant pool entries will not need to be resorted (for example, by their type, as the Java compiler does), so that the final index value can be assigned and used when an entry is first created. Note that new entries cannot be created after the constant pool has been written to a class file. To prevent such logic errors, a ConstantPool instance can be marked "read only", so that further attempts to add new entries will fail with a runtime exception. See JVMS section 4.4 for more information about the constant pool of a class file.
Method from sun.misc.ProxyGenerator$ConstantPool Summary:
getClass,   getFieldRef,   getFloat,   getInteger,   getInterfaceMethodRef,   getMethodRef,   getNameAndType,   getString,   getUtf8,   setReadOnly,   write
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from sun.misc.ProxyGenerator$ConstantPool Detail:
 public short getClass(String name) 
    Get or assign the index for a CONSTANT_Class entry.
 public short getFieldRef(String className,
    String name,
    String descriptor) 
    Get or assign the index for a CONSTANT_FieldRef entry.
 public short getFloat(float f) 
    Get or assign the index for a CONSTANT_Float entry.
 public short getInteger(int i) 
    Get or assign the index for a CONSTANT_Integer entry.
 public short getInterfaceMethodRef(String className,
    String name,
    String descriptor) 
    Get or assign the index for a CONSTANT_InterfaceMethodRef entry.
 public short getMethodRef(String className,
    String name,
    String descriptor) 
    Get or assign the index for a CONSTANT_MethodRef entry.
 public short getNameAndType(String name,
    String descriptor) 
    Get or assign the index for a CONSTANT_NameAndType entry.
 public short getString(String s) 
    Get or assign the index for a CONSTANT_String entry.
 public short getUtf8(String s) 
    Get or assign the index for a CONSTANT_Utf8 entry.
 public  void setReadOnly() 
    Set this ConstantPool instance to be "read only". After this method has been called, further requests to get an index for a non-existent entry will cause an InternalError to be thrown instead of creating of the entry.
 public  void write(OutputStream out) throws IOException 
    Write this constant pool to a stream as part of the class file format. This consists of writing the "constant_pool_count" and "constant_pool[]" items of the "ClassFile" structure, as described in JVMS section 4.1.