Logo Search packages:      
Sourcecode: jasmin-sable version File versions  Download package

jasmin::ClassFile Class Reference

List of all members.

Detailed Description

A ClassFile object is used to represent the binary data that makes up a Java class file - it also serves as the public API to the Jasmin assembler, though users should beware: the API is likely to change in future versions (though its such a small API at the moment that changes are likely to have only a small impact).

To assemble a file, you first construct a jasmin.ClassFile object, then call readJasmin() to read in the contents of a Jasmin assembly file, then call write() to write out the binary representation of the class file.

There are a few other utility methods as well. See Main.java for an example which uses all of the public methods provided in ClassFile.

Jonathan Meyer
1.05, 8 Feb 1997

Definition at line 43 of file ClassFile.java.

Public Member Functions

void addGenericAttrToClass (GenericAttr g)
void addGenericAttrToField (String name, byte[] value)
void addGenericAttrToMethod (String name, byte[] value)
void addSootCodeAttr (String name, String value)
 ClassFile ()
int errorCount ()
String getClassName ()
void readJasmin (InputStream input, String name, boolean numberLines) throws IOException, Exception
void write (OutputStream outp) throws IOException, jasError

Package Functions

CodeAttr _getCode () throws jasError
void addCatch (String name, String start_lab, String end_lab, String branch_lab) throws jasError
void addField (short access, String name, String sig, Object value)
void addInterface (String name)
void addLine (int line_num) throws jasError
void addLineInfo (int line_num) throws jasError
void addLookupswitch (int val, String label) throws jasError
void addTableswitch (String label) throws jasError
void addThrow (String name) throws jasError
void addVar (String startLab, String endLab, String name, String sig, int var_num) throws jasError
void autoNumber () throws jasError
void endLookupswitch (String deflabel) throws jasError
void endMethod () throws jasError
void endTableswitch (String deflabel) throws jasError
Label getLabel (String name) throws jasError
void newLookupswitch () throws jasError
void newMethod (String name, String signature, int access)
void newTableswitch (int lowval, int hival) throws jasError
void newTableswitch (int lowval) throws jasError
void plant (String name, String v1, String v2) throws jasError
void plant (String name, String val) throws jasError
void plant (String name, String val, int nargs) throws jasError
void plant (String name, Number val) throws jasError
void plant (String name, int val) throws jasError
void plant (String name, int v1, int v2) throws jasError
void plant (String name) throws jasError
void plantLabel (String name) throws jasError
void plantString (String name, String val) throws jasError
void report_error (String msg)
void setClass (String name, short acc)
void setLine (int l)
void setSource (String name)
void setStackSize (short v) throws jasError
void setSuperClass (String name)
void setVarSize (short v) throws jasError

Package Attributes

boolean auto_number
Catchtable catch_table
ClassEnv class_env
String class_name
CodeAttr code
Var currentField
Method currentMethod
int errors
ExceptAttr except_attr
String filename
int high_value
Hashtable labels
int lastInstSize
int line_label_count
int line_num
LineTableAttr line_table
int low_value
short method_access
String method_name
String method_signature
Scanner scanner
String source_name
Vector switch_vec
LocalVarTableAttr var_table

Static Package Attributes

static final String BGN_METHOD = "bgnmethod:"
static final String END_METHOD = "endmethod:"

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index