Public Methods | |
Body | buildBodyOfFrom (SootMethod m, Body sourceBody, int options) |
boolean | readClass (DataInputStream d) |
String | toString () |
Static Public Methods | |
ClassFile | v () |
Public Attributes | |
cp_info | constant_pool [] |
int | this_class |
Protected Methods | |
boolean | readAttributes (DataInputStream d, int attributes_count, attribute_info[] ai) throws IOException |
boolean | readConstantPool (DataInputStream d) throws IOException |
boolean | readFields (DataInputStream d) throws IOException |
boolean | readMethods (DataInputStream d) throws IOException |
boolean | writeAttributes (DataOutputStream dd, int attributes_count, attribute_info[] ai) throws IOException |
boolean | writeConstantPool (DataOutputStream dd) throws IOException |
boolean | writeFields (DataOutputStream dd) throws IOException |
boolean | writeMethods (DataOutputStream dd) throws IOException |
Private Methods | |
ClassFile () | |
ClassFile (String nfn) | |
boolean | descendsFrom (ClassFile cf) |
boolean | descendsFrom (String cname) |
String | fieldName (int i) |
method_info | findMethod (String s) |
boolean | isSterile () |
void | listConstantPool () |
void | listFields () |
void | listMethods () |
boolean | loadClassFile () |
void | moveMethod (String m, int pos) |
void | parse () |
Instruction | parseMethod (method_info m) |
int | relabel (Instruction i) |
boolean | sameClass (String cfn) |
boolean | saveClassFile () |
void | unparse () |
byte[] | unparseMethod (method_info m) |
boolean | writeClass (DataOutputStream dd) |
Static Private Methods | |
String | access_string (int af, String separator) |
String | parseDesc (String desc, String sep) |
String | parseMethodDesc_params (String s) |
String | parseMethodDesc_return (String s) |
Private Attributes | |
boolean | debug |
String | fn |
long | magic |
int | minor_version |
int | major_version |
int | constant_pool_count |
int | access_flags |
int | super_class |
int | interfaces_count |
int | interfaces [] |
int | fields_count |
field_info | fields [] |
int | methods_count |
method_info | methods [] |
int | attributes_count |
attribute_info | attributes [] |
Static Private Attributes | |
ClassFile | classFileRepresentation = new ClassFile() |
final long | MAGIC = 0xCAFEBABEL |
final short | ACC_PUBLIC = 0x0001 |
final short | ACC_PRIVATE = 0x0002 |
final short | ACC_PROTECTED = 0x0004 |
final short | ACC_STATIC = 0x0008 |
final short | ACC_FINAL = 0x0010 |
final short | ACC_SUPER = 0x0020 |
final short | ACC_VOLATILE = 0x0040 |
final short | ACC_TRANSIENT = 0x0080 |
final short | ACC_INTERFACE = 0x0200 |
final short | ACC_ABSTRACT = 0x0400 |
final short | ACC_UNKNOWN = 0x7800 |
final String | DESC_BYTE = "B" |
final String | DESC_CHAR = "C" |
final String | DESC_DOUBLE = "D" |
final String | DESC_FLOAT = "F" |
final String | DESC_INT = "I" |
final String | DESC_LONG = "J" |
final String | DESC_OBJECT = "L" |
final String | DESC_SHORT = "S" |
final String | DESC_BOOLEAN = "Z" |
final String | DESC_VOID = "V" |
final String | DESC_ARRAY = "[" |
.class
file.
A ClassFile contains code for manipulation of its constituents.
Definition at line 78 of file ClassFile.java.
|
Creates a new ClassFile object given the name of the file.
Definition at line 435 of file coffi/ClassFile.java. |
|
Returns a String constructed by parsing the bits in the given access code (as defined by the ACC_* constants).
Definition at line 444 of file coffi/ClassFile.java. |
|
Returns a Body representing the ClassFile body. Only 'null' can be passed as the source. Definition at line 89 of file ClassFile.java. |
|
Answers whether this class is an immediate descendant (as subclass or as an implementation of an interface) of the given class.
Definition at line 516 of file coffi/ClassFile.java. |
|
Answers whether this class is an immediate descendant (as subclass or as an implementation of an interface) of the given class.
Definition at line 509 of file coffi/ClassFile.java. |
|
Returns the name of a specific field in the field array.
Definition at line 531 of file coffi/ClassFile.java. |
|
Locates a method by name.
Definition at line 539 of file coffi/ClassFile.java. |
|
Answers whether this class can have subclasses outside its package.
Definition at line 554 of file coffi/ClassFile.java. |
|
Displays the entire constant pool. Definition at line 563 of file coffi/ClassFile.java. |
|
Displays the list of fields defined in this ClassFile, including any static initializers (constants).
Definition at line 586 of file coffi/ClassFile.java. |
|
Displays a the prototypes for all the methods defined in this ClassFile.
Definition at line 615 of file coffi/ClassFile.java. |
|
Main entry point for reading in a class file. The file name is given in the constructor; this opens the file and reads in the contents, building the representation.
Definition at line 627 of file coffi/ClassFile.java. |
|
Moves a method to a different index in the methods array.
Definition at line 666 of file coffi/ClassFile.java. |
|
For every method, this calls parseMethod, storing the list of Instructions in the method_info object, and also constructs the corresponding CFG.
Definition at line 693 of file coffi/ClassFile.java. Referenced by loadClassFile().
|
|
Static utility method to parse the given method descriptor string.
Definition at line 711 of file coffi/ClassFile.java. Referenced by parseMethodDesc_params(), and parseMethodDesc_return().
|
|
Parses the given method, converting its bytecode array into a list of Instruction objects.
Definition at line 777 of file coffi/ClassFile.java. Referenced by parse().
|
|
Static utility method to parse the given method descriptor string.
Definition at line 837 of file coffi/ClassFile.java. |
|
Static utility method to parse the given method descriptor string.
Definition at line 854 of file coffi/ClassFile.java. |
|
Reads in the given number of attributes from the given stream.
Definition at line 869 of file coffi/ClassFile.java. Referenced by readClass(), readFields(), and readMethods().
|
|
Builds the internal representation of this Class by reading in the given class file.
Definition at line 975 of file coffi/ClassFile.java. Referenced by loadClassFile().
|
|
Reads in the constant pool from the given stream.
Definition at line 1038 of file coffi/ClassFile.java. Referenced by readClass().
|
|
Reads in the fields from the given stream.
Definition at line 1164 of file coffi/ClassFile.java. Referenced by readClass().
|
|
Reads in the methods from the given stream.
Definition at line 1193 of file coffi/ClassFile.java. Referenced by readClass().
|
|
Recomputes the offset of each Instruction starting from 0; used when converting references back to offsets.
Definition at line 1231 of file coffi/ClassFile.java. Referenced by unparseMethod().
|
|
Given the name of a class --- possibly with
Definition at line 1244 of file coffi/ClassFile.java. |
|
Main entry point for writing a class file. The file name is given in the constructor; this opens the file and writes the internal representation.
Definition at line 1259 of file coffi/ClassFile.java. |
|
Returns the name of this Class. Definition at line 1302 of file coffi/ClassFile.java. Referenced by descendsFrom(), and sameClass().
|
|
Inversive to parse, this method calls unparseMethod for each method, storing the resulting bytecode in the method's code attribute, and recomputing offsets for exception handlers.
Definition at line 1310 of file coffi/ClassFile.java. |
|
Inversive to parseMethod, this converts the list of Instructions stored in a method_info object back to an array of bytecode.
Definition at line 1351 of file coffi/ClassFile.java. Referenced by unparse().
|
|
Writes the given array of attributes to the given stream.
Definition at line 1388 of file coffi/ClassFile.java. Referenced by writeClass(), writeFields(), and writeMethods().
|
|
Writes this entire ClassFile object to the given stream.
Definition at line 1470 of file coffi/ClassFile.java. Referenced by saveClassFile().
|
|
Writes the current constant pool to the given stream.
Definition at line 1528 of file coffi/ClassFile.java. Referenced by writeClass().
|
|
Writes the fields to the given stream.
Definition at line 1598 of file coffi/ClassFile.java. Referenced by writeClass().
|
|
Writes the methods to the given stream.
Definition at line 1619 of file coffi/ClassFile.java. Referenced by writeClass().
|
|
Access bit flag. Definition at line 160 of file coffi/ClassFile.java. |
|
Access bit flag. Definition at line 150 of file coffi/ClassFile.java. |
|
Access bit flag. Definition at line 158 of file coffi/ClassFile.java. |
|
Access bit flag. Definition at line 144 of file coffi/ClassFile.java. |
|
Access bit flag. Definition at line 146 of file coffi/ClassFile.java. |
|
Access bit flag. Definition at line 142 of file coffi/ClassFile.java. |
|
Access bit flag. Definition at line 148 of file coffi/ClassFile.java. |
|
Access bit flag. Definition at line 152 of file coffi/ClassFile.java. |
|
Access bit flag. Definition at line 156 of file coffi/ClassFile.java. |
|
Remaining bits in the access bit flag. Definition at line 162 of file coffi/ClassFile.java. |
|
Access bit flag. Definition at line 154 of file coffi/ClassFile.java. |
|
Descriptor code string. Definition at line 185 of file coffi/ClassFile.java. |
|
Descriptor code string. Definition at line 181 of file coffi/ClassFile.java. |
|
Descriptor code string. Definition at line 165 of file coffi/ClassFile.java. |
|
Descriptor code string. Definition at line 167 of file coffi/ClassFile.java. |
|
Descriptor code string. Definition at line 169 of file coffi/ClassFile.java. |
|
Descriptor code string. Definition at line 171 of file coffi/ClassFile.java. |
|
Descriptor code string. Definition at line 173 of file coffi/ClassFile.java. |
|
Descriptor code string. Definition at line 175 of file coffi/ClassFile.java. |
|
Descriptor code string. Definition at line 177 of file coffi/ClassFile.java. |
|
Descriptor code string. Definition at line 179 of file coffi/ClassFile.java. |
|
Descriptor code string. Definition at line 183 of file coffi/ClassFile.java. |
|
Magic number. Definition at line 139 of file coffi/ClassFile.java. |
|
Access flags for this Class. Definition at line 212 of file coffi/ClassFile.java. |
|
Array of attribute_info objects for this class.
Definition at line 246 of file coffi/ClassFile.java. |
|
Count of attributes this class contains. Definition at line 242 of file coffi/ClassFile.java. |
|
Array of constant pool items.
Definition at line 209 of file coffi/ClassFile.java. |
|
Number of items in the constant pool. Definition at line 205 of file coffi/ClassFile.java. |
|
Debugging flag. Definition at line 188 of file coffi/ClassFile.java. |
|
Array of field_info objects describing each field.
Definition at line 234 of file coffi/ClassFile.java. |
|
Count of fields this Class contains. Definition at line 230 of file coffi/ClassFile.java. |
|
File name of the Definition at line 191 of file coffi/ClassFile.java. |
|
Array of constant pool indices of Class constants describing each interace implemented by this class, as given in the source for this class.
Definition at line 228 of file coffi/ClassFile.java. |
|
Count of interfaces implemented. Definition at line 222 of file coffi/ClassFile.java. |
|
Magic number read in.
Definition at line 199 of file coffi/ClassFile.java. |
|
Major version. Definition at line 203 of file coffi/ClassFile.java. |
|
Array of method_info objects describing each field.
Definition at line 240 of file coffi/ClassFile.java. |
|
Count of methods this Class contains. Definition at line 236 of file coffi/ClassFile.java. |
|
Minor version. Definition at line 201 of file coffi/ClassFile.java. |
|
Constant pool index of the Class constant describing super.
Definition at line 220 of file coffi/ClassFile.java. |
|
Constant pool index of the Class constant describing this.
Definition at line 216 of file coffi/ClassFile.java. |