|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jdo.api.persistence.enhancer.classfile.ClassFile
public final class ClassFile
ClassFile models the structure of a class as represented within a class file.
| Field Summary | |
|---|---|
static short[][] |
jdkMajorMinorVersions
|
static List |
jdkVersions
|
static int |
magic
|
static String |
supportedVersions
|
| Constructor Summary | |
|---|---|
ClassFile(DataInputStream data)
Construct a ClassFile from an input stream |
|
ClassFile(String cname,
String supername)
Construct a bare bones class, ready for additions |
|
| Method Summary | |
|---|---|
int |
access()
Return the access flags for the class - see VMConstants |
void |
addField(ClassField field)
Add a field to the list of the fields which the class contains |
void |
addField(ClassField field,
int index)
Add a field to the list of the fields which the class contains, at the index'th position. |
void |
addInterface(ConstClass iface)
Add an interface to the list of the interfaces which the class implements |
void |
addMethod(ClassMethod method)
Add a method to the list of the methods which the class defines |
AttributeVector |
attributes()
Return the list of the attributes associated with the class |
ConstClass |
className()
Return the name of the class |
Vector |
fields()
Return the list of the fields which the class contains The contents are ClassField objects |
ClassField |
findField(String fieldName)
Look for a field with the specified name |
ClassMethod |
findMethod(String methodName,
String methodSig)
Look for a method with the specified name and type signature |
byte[] |
getBytes()
Returns a byte array representation of this class. |
Vector |
interfaces()
Return the list of the interfaces which the class implements The contents are ConstClass objects |
boolean |
isAbstract()
Is the class abstract? |
boolean |
isFinal()
Is the class final? |
boolean |
isInterface()
Is the class an interface? |
boolean |
isPublic()
Is the class public? |
Vector |
methods()
Return the list of the methods which the class defines The contents are ClassMethod objects |
ConstantPool |
pool()
Return the constant pool for the class file |
void |
print(PrintStream out)
|
static String |
printSupportedVersions()
|
void |
setAccessFlags(int flags)
Set the access flags for the class - see VMConstants |
void |
setSuperName(ConstClass superCl)
Set the name of the super class |
void |
summarize()
|
ConstClass |
superName()
Return the name of the super class |
String |
superNameString()
Return the name of the super class as a string |
void |
write(DataOutputStream buff)
Write the Class file to the data output stream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int magic
public static final short[][] jdkMajorMinorVersions
public static final List jdkVersions
public static final String supportedVersions
| Constructor Detail |
|---|
public ClassFile(DataInputStream data)
throws ClassFormatError
ClassFormatError
public ClassFile(String cname,
String supername)
| Method Detail |
|---|
public ConstantPool pool()
public int access()
public final boolean isFinal()
public final boolean isInterface()
public final boolean isPublic()
public final boolean isAbstract()
public void setAccessFlags(int flags)
public ConstClass className()
public ConstClass superName()
public String superNameString()
public void setSuperName(ConstClass superCl)
public Vector interfaces()
public void addInterface(ConstClass iface)
public Vector fields()
public void addField(ClassField field)
public void addField(ClassField field,
int index)
public Vector methods()
public ClassMethod findMethod(String methodName,
String methodSig)
public void addMethod(ClassMethod method)
public ClassField findField(String fieldName)
public AttributeVector attributes()
public void write(DataOutputStream buff)
throws IOException
IOException
public byte[] getBytes()
throws IOException
IOExceptionpublic void print(PrintStream out)
public void summarize()
public static final String printSupportedVersions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||