All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----harpoon.ClassFile.Raw.ClassFile
Drawn from The Java Virtual Machine Specification.
access_flags
item is a mask of
modifiers used with class and interface declarations.
attributes
table must be a
variable-length attribute structure.
constant_pool
is a table of variable-length
structures representing various string constants, class names,
field names, and other constants that are referred to within the
ClassFile
structure and its substructures.
fields
table must be a
variable-length field_info
structure giving a
complete description of a field in the class or interface type.
interfaces
array must be a valid
index into the constant_pool
table.
class
file.
methods
table must be a
variable-length method_info
structure giving a
complete description of and Java Virtual Machine code for a
method in the class or interface.
class
file.
super_class
item
either must be zero or must be a valid index into the
constant_pool
table.
this_class
item must be a valid
index into the constant_pool
table.
ClassFile
object by reading data from a
bytecode file.
ClassFile
object by reading data from a
bytecode file.
s
to PrintWriter pw
at
the given indentation level indent
.
CONSTANT_Class_info
entry in the
constant_pool
corresponding to the value in
interfaces[i]
.
CONSTANT_Class_info
entry in the
constant_pool
corresponding to the value of
super_class
, or null
if
super_class
== 0.
CONSTANT_Class_info
entry in the
constant_pool
corresponding to the value of
this_class
.
public int minor_version
class
file.
public int major_version
class
file.
public Constant constant_pool[]
constant_pool
is a table of variable-length
structures representing various string constants, class names,
field names, and other constants that are referred to within the
ClassFile
structure and its substructures.
The first entry of the constant_pool
table,
constant_pool[0]
, is reserved for internal use by a
Java Virtual Machine Implementation. That entry is not
present in the class
file.
public AccessFlags access_flags
access_flags
item is a mask of
modifiers used with class and interface declarations.
public int this_class
this_class
item must be a valid
index into the constant_pool
table. The
constant_pool
entry at that index must be a
CONSTANT_Class_info
structure representing the
class or interface defined by this class
file.
public int super_class
super_class
item
either must be zero or must be a valid index into the
constant_pool
table. If the value of the
super_class
item is nonzero, the
constant_pool
entry at that index must be a
CONSTANT_Class_info
structure representing the
superclass of the class defined by this class
file. Neither the superclass nor any of its superclasses may be
a final
class.
If the value of super_class
is zero, then this
class
file must represent that class
java.lang.Object
, the only class or interface
without a superclass.
For an interface, the value of super_class
must
always be a valid index into the constant_pool
table. The constant_pool
entry at that index must
be a CONSTANT_Class_info
structure representing the
class java.lang.Object
.
public int interfaces[]
interfaces
array must be a valid
index into the constant_pool
table. The
constant_pool
entry at each value of
interfaces[i]
must be a
CONSTANT_Class_info
structure representing an
interface which is a direct superinterface of this class or
interface type, in the left-to-right order given in the source
for the type.
public FieldInfo fields[]
fields
table must be a
variable-length field_info
structure giving a
complete description of a field in the class or interface type.
The fields
table includes only those fields that
are declared by this class or interface. It does not include
items representing fields that are inherited from superclasses
or superinterfaces.
public MethodInfo methods[]
methods
table must be a
variable-length method_info
structure giving a
complete description of and Java Virtual Machine code for a
method in the class or interface.
The method_info
structures represent all methods,
both instance methods and, for classes, class
(static
) methods, declared by this class or
interface type. The methods
table only includes
those items that are explicitly declared by this class.
Interfaces have only the single method
<clinit>
, the interface initialization
method. The methods
table does not include items
representing methods that are inherited from superclasses or
superinterfaces.
public Attribute attributes[]
attributes
table must be a
variable-length attribute structure. A ClassFile
structure can have any number of attributes associated with it.
The only attribute defined by this specification for the
attributes
table of a ClassFile
structure is the SourceFile
attribute.
public ClassFile(ClassDataInputStream in)
ClassFile
object by reading data from a
bytecode file.
public ClassFile(InputStream in)
ClassFile
object by reading data from a
bytecode file.
public void read(ClassDataInputStream in) throws IOException
public void write(ClassDataOutputStream out) throws IOException
public void write(OutputStream out) throws IOException
public ConstantClass this_class()
CONSTANT_Class_info
entry in the
constant_pool
corresponding to the value of
this_class
.
public ConstantClass super_class()
CONSTANT_Class_info
entry in the
constant_pool
corresponding to the value of
super_class
, or null
if
super_class
== 0.
public ConstantClass interfaces(int i)
CONSTANT_Class_info
entry in the
constant_pool
corresponding to the value in
interfaces[i]
.
public int constant_pool_count()
public int interfaces_count()
public int fields_count()
public int methods_count()
public int attributes_count()
public void print(PrintWriter pw)
public void print(PrintWriter pw, int indent)
public static void indent(PrintWriter pw, int indent, String s)
s
to PrintWriter pw
at
the given indentation level indent
.
All Packages Class Hierarchy This Package Previous Next Index