Javassist 3.15.0-GA-redhat-2

javassist.bytecode
Class ClassFileWriter.ConstPoolWriter

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

public static final class ClassFileWriter.ConstPoolWriter
extends Object

Constant Pool.


Field Summary
protected  int num
           
protected  int startPos
           
 
Method Summary
 int addClassInfo(int name)
          Adds a new CONSTANT_Class_info structure.
 int addClassInfo(String jvmname)
          Adds a new CONSTANT_Class_info structure.
 int[] addClassInfo(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(String name, String type)
          Adds a new CONSTANT_NameAndType_info structure.
 int addStringInfo(String str)
          Adds a new CONSTANT_String_info structure.
 int addUtf8Info(String utf8)
          Adds a new CONSTANT_Utf8_info structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startPos

protected int startPos

num

protected int num
Method Detail

addClassInfo

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

Returns:
an array of indexes indicating CONSTANT_Class_infos.

addClassInfo

public int addClassInfo(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(String name,
                              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(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(String utf8)
Adds a new CONSTANT_Utf8_info structure.

Returns:
the index of the added entry.

Javassist 3.15.0-GA-redhat-2

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.