|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.jcr.ClassFile
public class ClassFile
This class is used to both represent a Java class file and to read that class file.
$Id: ClassFile.java,v 1.15 2007-10-04 19:58:15 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Field Summary | |
---|---|
static int |
ACC_ABSTRACT
|
static int |
ACC_FINAL
|
static int |
ACC_INTERFACE
|
static int |
ACC_NATIVE
|
static int |
ACC_PRIVATE
|
static int |
ACC_PROTECTED
|
static int |
ACC_PUBLIC
The access masks. |
static int |
ACC_STATIC
|
static int |
ACC_SUPER
|
static int |
ACC_SYNCHRONIZED
|
static int |
ACC_TRANSIENT
|
static int |
ACC_VOLATILE
|
static int |
classesRead
A running counter of the number of Java class files read. |
Constructor Summary | |
---|---|
ClassFile(java.lang.String name)
Read in the specified Java class file. |
Method Summary | |
---|---|
void |
addRefClasses(Stack<java.lang.String> wl)
Adds all the class names referenced by this class to the stack. |
static void |
closeZipFiles()
Closes any zip or jar files opened to read any class. |
int |
getAccessFlags()
Return the accessFlags field of the class file. |
AttributeInfo |
getAttribute(int index)
Return the attribute entry specified. |
AttributeInfo[] |
getAttributes()
Return an array of the AttributeInfo structures for the class. |
CPInfo |
getCP(int index)
Return the constant pool entry specified. |
FieldInfo |
getField(int index)
Return the field entry specified. |
FieldInfo[] |
getFields()
Return an array of the FieldInfo structures for the class. |
int |
getInterface(int index)
Return the interface index specified. |
int[] |
getInterfaces()
Return an array of interface indexs into the constant pool. |
int |
getMagic()
Return the magic field of the class file. |
int |
getMajorVersion()
Return the majorVersion field of the class file. |
MethodInfo |
getMethod(int index)
Return the method entry specified. |
MethodInfo[] |
getMethods()
Return an array of the MethodInfo structures for the class. |
int |
getMinorVersion()
Return the minorVersion field of the class file. |
java.lang.String |
getName(int index)
Return the name of entry in the constant pool. |
java.lang.String |
getString(int index)
Return the String from the constant pool. |
int |
getSuperClass()
Return the superClass field of the class file. |
int |
getThisClass()
Return the thisClass field of the class file. |
int |
numCPEntries()
Return the number of constant pool entries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ACC_PUBLIC
public static final int ACC_PRIVATE
public static final int ACC_PROTECTED
public static final int ACC_STATIC
public static final int ACC_FINAL
public static final int ACC_SUPER
public static final int ACC_SYNCHRONIZED
public static final int ACC_VOLATILE
public static final int ACC_TRANSIENT
public static final int ACC_NATIVE
public static final int ACC_INTERFACE
public static final int ACC_ABSTRACT
public static int classesRead
Constructor Detail |
---|
public ClassFile(java.lang.String name) throws InvalidException
InvalidException
- if the class file was
not read successfullyMethod Detail |
---|
public int getMagic()
public int getMinorVersion()
public int getMajorVersion()
public int getAccessFlags()
public int getThisClass()
public int getSuperClass()
public int numCPEntries()
public CPInfo getCP(int index)
public java.lang.String getName(int index)
index
- is an index into the constant pool of a Utf-8 stringpublic java.lang.String getString(int index)
index
- is an index into the constant pool of a Utf-8 stringpublic int getInterface(int index)
public int[] getInterfaces()
public FieldInfo getField(int index)
public FieldInfo[] getFields()
public MethodInfo getMethod(int index)
public MethodInfo[] getMethods()
public AttributeInfo getAttribute(int index)
public AttributeInfo[] getAttributes()
public void addRefClasses(Stack<java.lang.String> wl)
public static void closeZipFiles()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |