|
||||||||||
| 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 java.util.List |
jdkVersions
|
static int |
magic
|
static java.lang.String |
supportedVersions
|
| Constructor Summary | |
|---|---|
ClassFile(java.io.DataInputStream data)
Construct a ClassFile from an input stream |
|
ClassFile(java.lang.String cname,
java.lang.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 |
java.util.Vector |
fields()
Return the list of the fields which the class contains The contents are ClassField objects |
ClassField |
findField(java.lang.String fieldName)
Look for a field with the specified name |
ClassMethod |
findMethod(java.lang.String methodName,
java.lang.String methodSig)
Look for a method with the specified name and type signature |
byte[] |
getBytes()
Returns a byte array representation of this class. |
java.util.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? |
java.util.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(java.io.PrintStream out)
|
static java.lang.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 |
java.lang.String |
superNameString()
Return the name of the super class as a string |
void |
write(java.io.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 java.util.List jdkVersions
public static final java.lang.String supportedVersions
| Constructor Detail |
|---|
public ClassFile(java.io.DataInputStream data)
throws java.lang.ClassFormatError
java.lang.ClassFormatError
public ClassFile(java.lang.String cname,
java.lang.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 java.lang.String superNameString()
public void setSuperName(ConstClass superCl)
public java.util.Vector interfaces()
public void addInterface(ConstClass iface)
public java.util.Vector fields()
public void addField(ClassField field)
public void addField(ClassField field,
int index)
public java.util.Vector methods()
public ClassMethod findMethod(java.lang.String methodName,
java.lang.String methodSig)
public void addMethod(ClassMethod method)
public ClassField findField(java.lang.String fieldName)
public AttributeVector attributes()
public void write(java.io.DataOutputStream buff)
throws java.io.IOException
java.io.IOException
public byte[] getBytes()
throws java.io.IOException
java.io.IOExceptionpublic void print(java.io.PrintStream out)
public void summarize()
public static final java.lang.String printSupportedVersions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||