|
ej-technologies | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gjt.jclasslib.structures.AbstractStructure
public abstract class AbstractStructure
Base class for all structures defined in the class file format.
Provides common services such as reading, writing and debugging.
| Field Summary | |
|---|---|
protected ClassFile |
classFile
Parent class file for this structure. |
protected boolean |
debug
Flag for debugging while reading and writing class files. |
static java.lang.String |
SYSTEM_PROPERTY_DEBUG
Set this JVM System property to true to switch on debugging for reading and writing class files. |
| Constructor Summary | |
|---|---|
protected |
AbstractStructure()
Constructor. |
| Method Summary | |
|---|---|
protected void |
debug(java.lang.String message)
Utility method for derived structures. |
ClassFile |
getClassFile()
Get parent class file. |
boolean |
getDebug()
Get the debug mode for this structure. |
protected int |
getLength(java.lang.Object array)
Utility method for derived structures. |
protected java.lang.String |
printAccessFlags(int accessFlags)
Utility method for derived structures. |
protected abstract java.lang.String |
printAccessFlagsVerbose(int accessFlags)
Utility method for derived structures. |
protected java.lang.String |
printAccessFlagsVerbose(int[] availableAccessFlags,
java.lang.String[] availableAccessFlagsVerbose,
int accessFlags)
Utility method for derived structures. |
protected java.lang.String |
printBytes(int bytes)
Utility method for derived structures. |
void |
read(java.io.DataInput in)
Read this structure from the given DataInput. |
void |
setClassFile(ClassFile classFile)
Set parent class file. |
void |
setDebug(boolean debug)
Set the debug mode for this structure. |
void |
write(java.io.DataOutput out)
Write this structure to the given DataOutput. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SYSTEM_PROPERTY_DEBUG
protected ClassFile classFile
protected boolean debug
| Constructor Detail |
|---|
protected AbstractStructure()
| Method Detail |
|---|
public ClassFile getClassFile()
public void setClassFile(ClassFile classFile)
Has to be called at least once on a structure.
classFile - the new parent class file
public void read(java.io.DataInput in)
throws InvalidByteCodeException,
java.io.IOException
Excpects DataInput to be in JVM class file format and just before a structure of this kind. No look ahead parsing since the class file format is deterministic.
in - the DataInput from which to read
InvalidByteCodeException - if the byte code is invalid
java.io.IOException - if an exception occurs with the DataInput
public void write(java.io.DataOutput out)
throws InvalidByteCodeException,
java.io.IOException
The written bytes are in JVM class file format.
out - the DataOutput to which to write
InvalidByteCodeException - if the structure is internally inconsistent
java.io.IOException - if an exception occurs with the DataOutputpublic boolean getDebug()
public void setDebug(boolean debug)
debug - the new debug modeprotected int getLength(java.lang.Object array)
array - the array for which the length is requested
protected void debug(java.lang.String message)
message - the debug messageprotected java.lang.String printBytes(int bytes)
bytes - the int value to print as a hex string
protected java.lang.String printAccessFlags(int accessFlags)
accessFlags - the unsigned short value to print as a hex string
protected abstract java.lang.String printAccessFlagsVerbose(int accessFlags)
accessFlags - the unsigned short value to print as a hex string
protected java.lang.String printAccessFlagsVerbose(int[] availableAccessFlags,
java.lang.String[] availableAccessFlagsVerbose,
int accessFlags)
availableAccessFlags - array with the access flags available
for the derived structureavailableAccessFlagsVerbose - array with verbose description
of the access flags available for the derived structureaccessFlags - the unsigned short value to print as a hex string
|
ej-technologies | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||