All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.builder.compiler.ClassFile
java.lang.Object
|
+----com.sun.wizards.builder.compiler.ClassConstants
|
+----com.sun.wizards.builder.compiler.ClassFile
- public class ClassFile
- extends ClassConstants
ClassFile is a class that reads a class file, facilitates
simple modifications to the class representation, and then
writes the class representation to a file.
The information used to write this class was obtained from
the book "The Java Virtual Machine Specification", pages
84 - 118.
Note: The use of all lower-case variable names with
underscores is done to show an exact translation
from the Virtual Machine Specification.
-
ClassFile(DataInput)
- Create a ClassFile object from the specified
input stream.
-
addAttribute(String, byte[])
- Add the specified class attribute to this class.
-
readClass(DataInput)
- Read the specified data stream, and interpret it as a
class byte representation.
-
setClassname(String)
- Rename the class represented by this object.
-
writeClass(DataOutput)
- Write the class representation contained in this object to
an output stream.
ClassFile
public ClassFile(DataInput in)
- Create a ClassFile object from the specified
input stream.
- Parameters:
- in - The input stream from which the
class bytes can be read.
setClassname
public void setClassname(String newClassName)
- Rename the class represented by this object.
This must be done after the class representation
has been created.
- Parameters:
- newClassName - The classname that this class
will be changed to.
addAttribute
public void addAttribute(String attributeName,
byte info[])
- Add the specified class attribute to this class.
- Parameters:
- attributeName - The name of the class
attribute to be added.
- info - The attribute data.
readClass
public void readClass(DataInput in)
- Read the specified data stream, and interpret it as a
class byte representation. The interpretation of the
class will be stored, and can be written later using
writeClass().
- Parameters:
- in - The input stream containing the class bytes.
writeClass
public void writeClass(DataOutput out)
- Write the class representation contained in this object to
an output stream. The format written complies with the
Java Class File specification.
- Parameters:
- out - The output stream on which this class should
be written.
All Packages Class Hierarchy This Package Previous Next Index