Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

JavaClass Class Reference

Inheritance diagram for JavaClass:
[legend]
Collaboration diagram for JavaClass:
[legend]
List of all members.

Public Methods

void accept (Visitor v)
JavaClass copy ()
void dump (DataOutputStream file) throws IOException
void dump (File file) throws IOException
void dump (OutputStream file) throws IOException
void dump (String file_name) throws IOException
Attribute[] getAttributes ()
byte[] getBytes ()
String getClassName ()
int getClassNameIndex ()
ConstantPool getConstantPool ()
Field[] getFields ()
String getFileName ()
String[] getInterfaceNames ()
int[] getInterfaces ()
int getMajor ()
Method[] getMethods ()
int getMinor ()
String getPackageName ()
String getSourceFileName ()
String getSuperclassName ()
int getSuperclassNameIndex ()
final boolean instanceOf (JavaClass super_class)
final boolean isClass ()
final boolean isSuper ()
void setAttributes (Attribute[] attributes)
void setClassName (String class_name)
void setClassNameIndex (int class_name_index)
void setConstantPool (ConstantPool constant_pool)
void setFields (Field[] fields)
void setFileName (String file_name)
void setInterfaceNames (String[] interface_names)
void setInterfaces (int[] interfaces)
void setMajor (int major)
void setMethods (Method[] methods)
void setMinor (int minor)
void setSourceFileName (String source_file_name)
void setSuperclassName (String superclass_name)
void setSuperclassNameIndex (int superclass_name_index)
String toString ()
 JavaClass (int class_name_index, int superclass_name_index, String file_name, int major, int minor, int access_flags, ConstantPool constant_pool, int[] interfaces, Field[] fields, Method[] methods, Attribute[] attributes, byte source)
void accept (Visitor v)
JavaClass copy ()
void dump (DataOutputStream file) throws IOException
void dump (File file) throws IOException
void dump (OutputStream file) throws IOException
void dump (String file_name) throws IOException
Attribute[] getAttributes ()
byte[] getBytes ()
String getClassName ()
int getClassNameIndex ()
ConstantPool getConstantPool ()
Field[] getFields ()
String getFileName ()
String[] getInterfaceNames ()
int[] getInterfaces ()
int getMajor ()
Method[] getMethods ()
int getMinor ()
String getPackageName ()
final byte getSource ()
String getSourceFileName ()
String getSuperclassName ()
int getSuperclassNameIndex ()
final boolean instanceOf (JavaClass super_class)
final boolean isClass ()
final boolean isSuper ()
void setAttributes (Attribute[] attributes)
void setClassName (String class_name)
void setClassNameIndex (int class_name_index)
void setConstantPool (ConstantPool constant_pool)
void setFields (Field[] fields)
void setFileName (String file_name)
void setInterfaceNames (String[] interface_names)
void setInterfaces (int[] interfaces)
void setMajor (int major)
void setMethods (Method[] methods)
void setMinor (int minor)
void setSourceFileName (String source_file_name)
void setSuperclassName (String superclass_name)
void setSuperclassNameIndex (int superclass_name_index)
String toString ()

Static Public Methods

 JavaClass (int class_name_index, int superclass_name_index, String file_name, int major, int minor, int access_flags, ConstantPool constant_pool, int[] interfaces, Field[] fields, Method[] methods, Attribute[] attributes)
 JavaClass (int class_name_index, int superclass_name_index, String file_name, int major, int minor, int access_flags, ConstantPool constant_pool, int[] interfaces, Field[] fields, Method[] methods, Attribute[] attributes)

Static Public Attributes

final byte HEAP = 1
final byte FILE = 2
final byte ZIP = 3

Static Private Methods

final void Debug (String str)
final String indent (Object obj)
final void Debug (String str)
final String indent (Object obj)

Private Attributes

String file_name
String package_name
String source_file_name = "<Unknown>"
int class_name_index
int superclass_name_index
String class_name
String superclass_name
int major
int minor
ConstantPool constant_pool
int[] interfaces
String[] interface_names
Field[] fields
Method[] methods
Attribute[] attributes
int[] interfaces
String[] interface_names
Field[] fields
Method[] methods
Attribute[] attributes
byte source = HEAP

Static Private Attributes

boolean debug = false
char sep = '/'

Detailed Description

Represents a Java class, i.e. the data structures, constant pool, fields, methods and commands contained in a Java .class file. See JVM specification for details.

Version:
Id:
JavaClass.java,v 1.1.1.1 2002/01/24 03:44:00 pserver Exp
Author:
M. Dahm

Definition at line 17 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.


Constructor & Destructor Documentation

JavaClass::JavaClass int   class_name_index,
int   superclass_name_index,
String   file_name,
int   major,
int   minor,
int   access_flags,
ConstantPool   constant_pool,
int   interfaces[],
Field   fields[],
Method   methods[],
Attribute   attributes[]
[inline, static]
 

Constructor gets all contents as arguments.

Parameters:
class_name   Class name
superclass_name   Superclass name
file_name   File name
major   Major compiler version
minor   Minor compiler version
access_flags   Access rights defined by bit flags
constant_pool   Array of constants
interfaces   Implemented interfaces
fields   Class fields
methods   Class methods
attributes   Class attributes

Definition at line 67 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

JavaClass::JavaClass int   class_name_index,
int   superclass_name_index,
String   file_name,
int   major,
int   minor,
int   access_flags,
ConstantPool   constant_pool,
int   interfaces[],
Field   fields[],
Method   methods[],
Attribute   attributes[]
[inline, static]
 

Constructor gets all contents as arguments.

Parameters:
class_name   Class name
superclass_name   Superclass name
file_name   File name
major   Major compiler version
minor   Minor compiler version
access_flags   Access rights defined by bit flags
constant_pool   Array of constants
interfaces   Implemented interfaces
fields   Class fields
methods   Class methods
attributes   Class attributes

Definition at line 72 of file src/de/fub/bytecode/classfile/JavaClass.java.

JavaClass::JavaClass int   class_name_index,
int   superclass_name_index,
String   file_name,
int   major,
int   minor,
int   access_flags,
ConstantPool   constant_pool,
int   interfaces[],
Field   fields[],
Method   methods[],
Attribute   attributes[],
byte   source
[inline]
 

Constructor gets all contents as arguments.

Parameters:
class_name   Class name
superclass_name   Superclass name
file_name   File name
major   Major compiler version
minor   Minor compiler version
access_flags   Access rights defined by bit flags
constant_pool   Array of constants
interfaces   Implemented interfaces
fields   Class fields
methods   Class methods
attributes   Class attributes
source   Read from file or generated in memory?

Definition at line 102 of file src/de/fub/bytecode/classfile/JavaClass.java.


Member Function Documentation

void JavaClass::accept Visitor   v [inline]
 

Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters:
v   Visitor object

Definition at line 183 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::accept Visitor   v [inline]
 

Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters:
v   Visitor object

Definition at line 146 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by DefaultVisitor::visit().

JavaClass JavaClass::copy   [inline]
 

Returns:
deep copy of this class

Definition at line 189 of file src/de/fub/bytecode/classfile/JavaClass.java.

JavaClass JavaClass::copy   [inline]
 

Returns:
deep copy of this class

Definition at line 152 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::dump String   file_name [inline]
 

Dump class to a file named file_name.

Parameters:
file_name   Output file name
Exceptions:
IOException  

Definition at line 294 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::dump OutputStream   file [inline]
 

Dump Java class to output stream in binary format.

Parameters:
file   Output stream
Exceptions:
IOException  

Definition at line 285 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::dump File   file [inline]
 

Dump class to a file.

Parameters:
file   Output file
Exceptions:
IOException  

Definition at line 266 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::dump DataOutputStream   file [inline]
 

Dump Java class to output stream in binary format.

Parameters:
file   Output stream
Exceptions:
IOException  

Definition at line 226 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::dump String   file_name [inline]
 

Dump class to a file named file_name.

Parameters:
file_name   Output file name
Exceptions:
IOException  

Definition at line 249 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::dump OutputStream   file [inline]
 

Dump Java class to output stream in binary format.

Parameters:
file   Output stream
Exceptions:
IOException  

Definition at line 240 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::dump File   file [inline]
 

Dump class to a file.

Parameters:
file   Output file
Exceptions:
IOException  

Definition at line 229 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::dump DataOutputStream   file [inline]
 

Dump Java class to output stream in binary format.

Parameters:
file   Output stream
Exceptions:
IOException  

Definition at line 189 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Attribute [] JavaClass::getAttributes   [inline]
 

Returns:
Attributes of the class.

Definition at line 301 of file src/de/fub/bytecode/classfile/JavaClass.java.

Attribute [] JavaClass::getAttributes   [inline]
 

Returns:
Attributes of the class.

Definition at line 256 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by ClassGen::ClassGen().

byte [] JavaClass::getBytes   [inline]
 

Returns:
class in binary format

Definition at line 305 of file src/de/fub/bytecode/classfile/JavaClass.java.

byte [] JavaClass::getBytes   [inline]
 

Returns:
class in binary format

Definition at line 260 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

String JavaClass::getClassName   [inline]
 

Returns:
Class name.

Definition at line 319 of file src/de/fub/bytecode/classfile/JavaClass.java.

String JavaClass::getClassName   [inline]
 

Returns:
Class name.

Definition at line 274 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by Class2HTML::Class2HTML(), ClassGen::ClassGen(), ClassInfo::ClassInfo(), Repository::addClass(), ClassInfo::loadSuperClass(), and Repository::removeClass().

int JavaClass::getClassNameIndex   [inline]
 

Returns:
Class name index.

Definition at line 323 of file src/de/fub/bytecode/classfile/JavaClass.java.

int JavaClass::getClassNameIndex   [inline]
 

Returns:
Class name index.

Definition at line 278 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by ClassGen::ClassGen().

ConstantPool JavaClass::getConstantPool   [inline]
 

Returns:
Constant pool.

Definition at line 327 of file src/de/fub/bytecode/classfile/JavaClass.java.

ConstantPool JavaClass::getConstantPool   [inline]
 

Returns:
Constant pool.

Definition at line 282 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by Class2HTML::Class2HTML(), ClassGen::ClassGen(), and ClassInfo::loadInterfaces().

Field [] JavaClass::getFields   [inline]
 

Returns:
Fields, i.e., variables of the class.

Definition at line 331 of file src/de/fub/bytecode/classfile/JavaClass.java.

Field [] JavaClass::getFields   [inline]
 

Returns:
Fields, i.e. variables of the class.

Definition at line 286 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by Class2HTML::Class2HTML(), ClassGen::ClassGen(), ClassInfo::loadDynamicFields(), and ClassInfo::loadStaticFields().

String JavaClass::getFileName   [inline]
 

Returns:
File name.

Definition at line 335 of file src/de/fub/bytecode/classfile/JavaClass.java.

String JavaClass::getFileName   [inline]
 

Returns:
File name.

Definition at line 290 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

String [] JavaClass::getInterfaceNames   [inline]
 

Returns:
Names of implemented interfaces.

Definition at line 339 of file src/de/fub/bytecode/classfile/JavaClass.java.

String [] JavaClass::getInterfaceNames   [inline]
 

Returns:
Names of implemented interfaces.

Definition at line 294 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by ClassGen::ClassGen(), and Repository::getInterfaces().

int [] JavaClass::getInterfaces   [inline]
 

Returns:
Implemented interfaces.

Definition at line 343 of file src/de/fub/bytecode/classfile/JavaClass.java.

int [] JavaClass::getInterfaces   [inline]
 

Returns:
Implemented interfaces.

Definition at line 298 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by ClassGen::ClassGen(), and ClassInfo::loadInterfaces().

int JavaClass::getMajor   [inline]
 

Returns:
Major number of compiler version.

Definition at line 347 of file src/de/fub/bytecode/classfile/JavaClass.java.

int JavaClass::getMajor   [inline]
 

Returns:
Major number of compiler version.

Definition at line 302 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by ClassGen::ClassGen().

Method [] JavaClass::getMethods   [inline]
 

Returns:
Methods of the class.

Definition at line 351 of file src/de/fub/bytecode/classfile/JavaClass.java.

Method [] JavaClass::getMethods   [inline]
 

Returns:
Methods of the class.

Definition at line 306 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by Class2HTML::Class2HTML(), ClassGen::ClassGen(), ClassInfo::loadDynamicMethods(), and ClassInfo::loadStaticMethods().

int JavaClass::getMinor   [inline]
 

Returns:
Minor number of compiler version.

Definition at line 355 of file src/de/fub/bytecode/classfile/JavaClass.java.

int JavaClass::getMinor   [inline]
 

Returns:
Minor number of compiler version.

Definition at line 310 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by ClassGen::ClassGen().

String JavaClass::getPackageName   [inline]
 

Returns:
Package name.

Definition at line 359 of file src/de/fub/bytecode/classfile/JavaClass.java.

String JavaClass::getPackageName   [inline]
 

Returns:
Package name.

Definition at line 314 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by ClassInfo::ClassInfo().

final byte JavaClass::getSource   [inline]
 

Returns:
returns either HEAP (generated), FILE, or ZIP

Definition at line 362 of file src/de/fub/bytecode/classfile/JavaClass.java.

String JavaClass::getSourceFileName   [inline]
 

Returns:
File name of source.

Definition at line 368 of file src/de/fub/bytecode/classfile/JavaClass.java.

String JavaClass::getSourceFileName   [inline]
 

Returns:
File name of source.

Definition at line 318 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by ClassGen::ClassGen(), and ClassInfo::ClassInfo().

String JavaClass::getSuperclassName   [inline]
 

Returns:
Superclass name.

Definition at line 372 of file src/de/fub/bytecode/classfile/JavaClass.java.

String JavaClass::getSuperclassName   [inline]
 

Returns:
Superclass name.

Definition at line 322 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by ClassGen::ClassGen(), Repository::getInterfaces(), and ClassInfo::loadSuperClass().

int JavaClass::getSuperclassNameIndex   [inline]
 

Returns:
Class name index.

Definition at line 376 of file src/de/fub/bytecode/classfile/JavaClass.java.

int JavaClass::getSuperclassNameIndex   [inline]
 

Returns:
Class name index.

Definition at line 326 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

Referenced by ClassGen::ClassGen().

void JavaClass::setAttributes Attribute   attributes[] [inline]
 

Parameters:
attributes.  

Definition at line 398 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setAttributes Attribute   attributes[] [inline]
 

Parameters:
attributes.  

Definition at line 348 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setClassName String   class_name [inline]
 

Parameters:
class_name.  

Definition at line 404 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setClassName String   class_name [inline]
 

Parameters:
class_name.  

Definition at line 354 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setClassNameIndex int   class_name_index [inline]
 

Parameters:
class_name_index.  

Definition at line 410 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setClassNameIndex int   class_name_index [inline]
 

Parameters:
class_name_index.  

Definition at line 360 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setConstantPool ConstantPool   constant_pool [inline]
 

Parameters:
constant_pool.  

Definition at line 416 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setConstantPool ConstantPool   constant_pool [inline]
 

Parameters:
constant_pool.  

Definition at line 366 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setFields Field   fields[] [inline]
 

Parameters:
fields.  

Definition at line 422 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setFields Field   fields[] [inline]
 

Parameters:
fields.  

Definition at line 372 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setFileName String   file_name [inline]
 

Parameters:
file_name.  

Definition at line 428 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setFileName String   file_name [inline]
 

Parameters:
file_name.  

Definition at line 378 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setInterfaceNames String   interface_names[] [inline]
 

Parameters:
interface_names.  

Definition at line 434 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setInterfaceNames String   interface_names[] [inline]
 

Parameters:
interface_names.  

Definition at line 384 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setInterfaces int   interfaces[] [inline]
 

Parameters:
interfaces.  

Definition at line 440 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setInterfaces int   interfaces[] [inline]
 

Parameters:
interfaces.  

Definition at line 390 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setMajor int   major [inline]
 

Parameters:
major.  

Definition at line 446 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setMajor int   major [inline]
 

Parameters:
major.  

Definition at line 396 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setMethods Method   methods[] [inline]
 

Parameters:
methods.  

Definition at line 452 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setMethods Method   methods[] [inline]
 

Parameters:
methods.  

Definition at line 402 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setMinor int   minor [inline]
 

Parameters:
minor.  

Definition at line 458 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setMinor int   minor [inline]
 

Parameters:
minor.  

Definition at line 408 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setSourceFileName String   source_file_name [inline]
 

Parameters:
source_file_name.  

Definition at line 464 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setSourceFileName String   source_file_name [inline]
 

Parameters:
source_file_name.  

Definition at line 414 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setSuperclassName String   superclass_name [inline]
 

Parameters:
superclass_name.  

Definition at line 470 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setSuperclassName String   superclass_name [inline]
 

Parameters:
superclass_name.  

Definition at line 420 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setSuperclassNameIndex int   superclass_name_index [inline]
 

Parameters:
superclass_name_index.  

Definition at line 476 of file src/de/fub/bytecode/classfile/JavaClass.java.

void JavaClass::setSuperclassNameIndex int   superclass_name_index [inline]
 

Parameters:
superclass_name_index.  

Definition at line 426 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.

String JavaClass::toString   [inline]
 

Returns:
String representing class contents.

Definition at line 482 of file src/de/fub/bytecode/classfile/JavaClass.java.

String JavaClass::toString   [inline]
 

Returns:
String representing class contents.

Definition at line 432 of file lib/jpf/de/fub/bytecode/classfile/JavaClass.java.


The documentation for this class was generated from the following files:
Generated at Thu Feb 7 07:17:47 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001