|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.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.io.DataInputStream data,
boolean allowJDK12ClassFiles)
|
|
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.lang.String |
classNameString()
Return the name of the class as a string |
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. |
SignatureAttribute |
getSignatureAttribute()
Returns the SignatureAttribute, if there's any, for 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 |
static java.lang.String |
packageOf(java.lang.String vmName)
Returns the vm package name for the vm class name. |
java.lang.String |
pkg()
Returns the vm package name for this class. |
ConstantPool |
pool()
Return the constant pool for the class file |
void |
print(java.io.PrintStream out)
|
void |
print(java.io.PrintStream out,
int indent)
|
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(java.io.PrintStream out,
int indent)
|
ConstClass |
superName()
Return the name of the super class |
java.lang.String |
superNameString()
Return the name of the super class as a string |
static java.lang.String |
userClassFromVMClass(java.lang.String vmName)
Returns the class name in user ('.' delimited) form. |
java.lang.String |
userClassName()
Returns the class name in user ('.' delimited) form. |
static java.lang.String |
vmClassFromUserClass(java.lang.String userName)
Returns the class name in VM ('/' delimited) form. |
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.io.DataInputStream data, boolean allowJDK12ClassFiles) throws java.lang.ClassFormatError
java.lang.ClassFormatError
public ClassFile(java.lang.String cname, java.lang.String supername)
Method Detail |
---|
public static final java.lang.String printSupportedVersions()
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 java.lang.String classNameString()
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 SignatureAttribute getSignatureAttribute()
public java.lang.String userClassName()
public static java.lang.String userClassFromVMClass(java.lang.String vmName)
public static java.lang.String vmClassFromUserClass(java.lang.String userName)
public java.lang.String pkg()
public static java.lang.String packageOf(java.lang.String vmName)
public void write(java.io.DataOutputStream buff) throws java.io.IOException
java.io.IOException
public byte[] getBytes() throws java.io.IOException
java.io.IOException
public void print(java.io.PrintStream out)
public void print(java.io.PrintStream out, int indent)
public void summarize(java.io.PrintStream out, int indent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |