All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gnu.bytecode.ClassType

java.lang.Object
   |
   +----gnu.bytecode.Type
           |
           +----gnu.bytecode.ObjectType
                   |
                   +----gnu.bytecode.ClassType

public class ClassType
extends ObjectType
implements AttrContainer

Variable Index

 o access_flags
 o constructor
 o major_version
 o minor_version

Constructor Index

 o ClassType()
 o ClassType(String)

Method Index

 o addField()
Add a new field to this class.
 o addField(String)
Add a new field to this class, and name the field.
 o addField(String, Type)
 o addField(String, Type, int)
 o addMethod(String)
 o addMethod(String, int)
 o addMethod(String, int, Type[], Type)
Add a method to this ClassType.
 o addMethod(String, String, int)
 o addMethod(String, Type[], Type, int)
 o constructors()
 o doFixups()
Do various fixups after generating code but before we can write it out.
 o fields()
 o getAttributes()
 o getConstant(int)
 o getConstants()
 o getField(String)
Find a field with the given name,or null.
 o getInterfaces()
 o getModifiers()
Return the modifiers (access flags) for this class.
 o getNameOrSignature()
 o getSourceFile()
Get the name of the SourceFile associated with this class.
 o getSuper()
 o make(String)
Find a ClassType with the given name, or create a new one.
 o methods()
 o setAttributes(Attribute)
 o setInterfaces(ClassType[])
 o setModifiers(int)
Set the modifiers (access flags) for this class.
 o setSourceFile(String)
Set the name of the SourceFile associated with this class.
 o setSuper(ClassType)
 o setSuper(String)
Set the superclass of the is class.
 o to_utf8(String)
Convert a String to a Utf8 byte array.
 o toString()
 o writeToArray()
 o writeToFile()
 o writeToFile(String)
 o writeToStream(OutputStream)

Variables

 o minor_version
 public static final int minor_version
 o major_version
 public static final int major_version
 o access_flags
 public int access_flags
 o constructor
 public Method constructor

Constructors

 o ClassType
 public ClassType()
 o ClassType
 public ClassType(String class_name)

Methods

 o make
 public static ClassType make(String name)
Find a ClassType with the given name, or create a new one. Use this for "library classes", where you need the field/method types, but not one where you are about to generate code for.

Parameters:
name - the name of the class (e..g. "java.lang.String").
 o getAttributes
 public final Attribute getAttributes()
 o setAttributes
 public final void setAttributes(Attribute attributes)
 o getConstants
 public final ConstantPool getConstants()
 o getConstant
 public final CpoolEntry getConstant(int i)
 o getModifiers
 public final int getModifiers()
Return the modifiers (access flags) for this class.

 o setModifiers
 public final void setModifiers(int flags)
Set the modifiers (access flags) for this class.

 o setSourceFile
 public void setSourceFile(String name)
Set the name of the SourceFile associated with this class.

 o getSourceFile
 public String getSourceFile()
Get the name of the SourceFile associated with this class.

 o setSuper
 public void setSuper(String name)
Set the superclass of the is class.

Parameters:
name - name of super class, or null if this is "Object".
 o setSuper
 public void setSuper(ClassType superClass)
 o getSuper
 public ClassType getSuper()
 o getInterfaces
 public ClassType[] getInterfaces()
 o getNameOrSignature
 public String getNameOrSignature()
Overrides:
getNameOrSignature in class ObjectType
 o setInterfaces
 public void setInterfaces(ClassType interfaces[])
 o getField
 public Field getField(String name)
Find a field with the given name,or null.

 o addField
 public Field addField()
Add a new field to this class.

 o addField
 public Field addField(String name)
Add a new field to this class, and name the field.

Parameters:
name - the name of the new field
 o addField
 public final Field addField(String name,
                             Type type)
 o addField
 public final Field addField(String name,
                             Type type,
                             int flags)
 o addMethod
 public Method addMethod(String name)
 o addMethod
 public Method addMethod(String name,
                         int flags)
 o addMethod
 public Method addMethod(String name,
                         Type arg_types[],
                         Type return_type,
                         int flags)
 o addMethod
 public Method addMethod(String name,
                         int flags,
                         Type arg_types[],
                         Type return_type)
Add a method to this ClassType. If an existing method matches, return that. Otherwise, create a new one. In contrast, the other addMethod methods always create new Methods.

 o addMethod
 public Method addMethod(String name,
                         String signature,
                         int flags)
 o methods
 public Enumeration methods()
 o fields
 public Enumeration fields()
 o constructors
 public Enumeration constructors()
 o doFixups
 public void doFixups()
Do various fixups after generating code but before we can write it out. This includes assigning constant pool indexes where needed, finalizing labels, etc.

 o writeToStream
 public void writeToStream(OutputStream stream) throws IOException
 o writeToFile
 public void writeToFile(String filename) throws IOException
 o writeToFile
 public void writeToFile() throws IOException
 o writeToArray
 public byte[] writeToArray() throws IOException
 o to_utf8
 public static byte[] to_utf8(String str)
Convert a String to a Utf8 byte array.

Parameters:
str - the input String.
Returns:
the input encoded as a utf8 byte array.
 o toString
 public String toString()
Overrides:
toString in class Type

All Packages  Class Hierarchy  This Package  Previous  Next  Index