javassist.bytecode
Class ClassFileWriter.ConstPoolWriter

java.lang.Object
  extended by javassist.bytecode.ClassFileWriter.ConstPoolWriter
Enclosing class:
ClassFileWriter

public static final class ClassFileWriter.ConstPoolWriter
extends java.lang.Object

Constant Pool.


Method Summary
 int addClassInfo(int name)
          Adds a new CONSTANT_Class_info structure.
 int addClassInfo(java.lang.String jvmname)
          Adds a new CONSTANT_Class_info structure.
 int[] addClassInfo(java.lang.String[] classNames)
          Makes CONSTANT_Class_info objects for each class name.
 int addDoubleInfo(double d)
          Adds a new CONSTANT_Double_info structure.
 int addFieldrefInfo(int classInfo, int nameAndTypeInfo)
          Adds a new CONSTANT_Fieldref_info structure.
 int addFloatInfo(float f)
          Adds a new CONSTANT_Float_info structure.
 int addIntegerInfo(int i)
          Adds a new CONSTANT_Integer_info structure.
 int addInterfaceMethodrefInfo(int classInfo, int nameAndTypeInfo)
          Adds a new CONSTANT_InterfaceMethodref_info structure.
 int addLongInfo(long l)
          Adds a new CONSTANT_Long_info structure.
 int addMethodrefInfo(int classInfo, int nameAndTypeInfo)
          Adds a new CONSTANT_Methodref_info structure.
 int addNameAndTypeInfo(int name, int type)
          Adds a new CONSTANT_NameAndType_info structure.
 int addNameAndTypeInfo(java.lang.String name, java.lang.String type)
          Adds a new CONSTANT_NameAndType_info structure.
 int addStringInfo(java.lang.String str)
          Adds a new CONSTANT_String_info structure.
 int addUtf8Info(java.lang.String utf8)
          Adds a new CONSTANT_Utf8_info structure.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addClassInfo

public int[] addClassInfo(java.lang.String[] classNames)
Makes CONSTANT_Class_info objects for each class name.

Returns:
an array of indexes indicating CONSTANT_Class_infos.

addClassInfo

public int addClassInfo(java.lang.String jvmname)
Adds a new CONSTANT_Class_info structure.

This also adds a CONSTANT_Utf8_info structure for storing the class name.

Parameters:
jvmname - the JVM-internal representation of a class name. e.g. java/lang/Object.
Returns:
the index of the added entry.

addClassInfo

public int addClassInfo(int name)
Adds a new CONSTANT_Class_info structure.

Parameters:
name - name_index
Returns:
the index of the added entry.

addNameAndTypeInfo

public int addNameAndTypeInfo(java.lang.String name,
                              java.lang.String type)
Adds a new CONSTANT_NameAndType_info structure.

Parameters:
name - name_index
type - descriptor_index
Returns:
the index of the added entry.

addNameAndTypeInfo

public int addNameAndTypeInfo(int name,
                              int type)
Adds a new CONSTANT_NameAndType_info structure.

Parameters:
name - name_index
type - descriptor_index
Returns:
the index of the added entry.

addFieldrefInfo

public int addFieldrefInfo(int classInfo,
                           int nameAndTypeInfo)
Adds a new CONSTANT_Fieldref_info structure.

Parameters:
classInfo - class_index
nameAndTypeInfo - name_and_type_index.
Returns:
the index of the added entry.

addMethodrefInfo

public int addMethodrefInfo(int classInfo,
                            int nameAndTypeInfo)
Adds a new CONSTANT_Methodref_info structure.

Parameters:
classInfo - class_index
nameAndTypeInfo - name_and_type_index.
Returns:
the index of the added entry.

addInterfaceMethodrefInfo

public int addInterfaceMethodrefInfo(int classInfo,
                                     int nameAndTypeInfo)
Adds a new CONSTANT_InterfaceMethodref_info structure.

Parameters:
classInfo - class_index
nameAndTypeInfo - name_and_type_index.
Returns:
the index of the added entry.

addStringInfo

public int addStringInfo(java.lang.String str)
Adds a new CONSTANT_String_info structure.

This also adds a new CONSTANT_Utf8_info structure.

Returns:
the index of the added entry.

addIntegerInfo

public int addIntegerInfo(int i)
Adds a new CONSTANT_Integer_info structure.

Returns:
the index of the added entry.

addFloatInfo

public int addFloatInfo(float f)
Adds a new CONSTANT_Float_info structure.

Returns:
the index of the added entry.

addLongInfo

public int addLongInfo(long l)
Adds a new CONSTANT_Long_info structure.

Returns:
the index of the added entry.

addDoubleInfo

public int addDoubleInfo(double d)
Adds a new CONSTANT_Double_info structure.

Returns:
the index of the added entry.

addUtf8Info

public int addUtf8Info(java.lang.String utf8)
Adds a new CONSTANT_Utf8_info structure.

Returns:
the index of the added entry.


Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2010 Shigeru Chiba. All Rights Reserved.