|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpolyglot.types.reflect.ClassFile
public class ClassFile
ClassFile represents a Java classfile as it is found on disk. The classfile is modelled according to the Java Virtual Machine Specification. Methods are provided to access the classfile at a very low level.
Attribute
,
ConstantValue
,
Field
,
Method
Field Summary | |
---|---|
protected Attribute[] |
attrs
|
protected java.io.File |
classFileSource
|
protected Constant[] |
constants
|
protected ExtensionInfo |
extensionInfo
|
protected Field[] |
fields
|
protected polyglot.types.reflect.InnerClasses |
innerClasses
|
protected int[] |
interfaces
|
protected java.util.Map |
jlcInfoCache
|
protected Method[] |
methods
|
protected int |
modifiers
|
protected int |
superClass
|
protected int |
thisClass
|
Constructor Summary | |
---|---|
ClassFile(java.io.File classFileSource,
byte[] code,
ExtensionInfo ext)
Constructor. |
Method Summary | |
---|---|
java.lang.String |
classNameCP(int index)
Get the class name at the given constant pool index. |
java.lang.String |
compilerVersion(java.lang.String ts)
Get the encoded compiler version used to compile the source. |
Attribute |
createAttribute(java.io.DataInputStream in,
java.lang.String name,
int nameIndex,
int length)
|
Field |
createField(java.io.DataInputStream in)
|
Method |
createMethod(java.io.DataInputStream in)
|
java.lang.String |
encodedClassType(java.lang.String typeSystemKey)
Get the encoded class type for the given type system. |
Attribute[] |
getAttrs()
|
Constant[] |
getConstants()
|
Field[] |
getFields()
|
polyglot.types.reflect.InnerClasses |
getInnerClasses()
|
int[] |
getInterfaces()
|
Method[] |
getMethods()
|
int |
getModifiers()
|
int |
getSuperClass()
|
int |
getThisClass()
|
java.lang.String |
name()
Get the name of the class, including the package name. |
void |
readAttributes(java.io.DataInputStream in)
Read the class's attributes. |
long |
sourceLastModified(java.lang.String ts)
Get the encoded source modified time. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Constant[] constants
protected int modifiers
protected int thisClass
protected int superClass
protected int[] interfaces
protected Field[] fields
protected Method[] methods
protected Attribute[] attrs
protected polyglot.types.reflect.InnerClasses innerClasses
protected java.io.File classFileSource
protected ExtensionInfo extensionInfo
protected java.util.Map jlcInfoCache
Constructor Detail |
---|
public ClassFile(java.io.File classFileSource, byte[] code, ExtensionInfo ext)
code
- A byte array containing the class dataMethod Detail |
---|
public long sourceLastModified(java.lang.String ts)
public java.lang.String compilerVersion(java.lang.String ts)
public java.lang.String encodedClassType(java.lang.String typeSystemKey)
public java.lang.String classNameCP(int index)
public java.lang.String name()
public void readAttributes(java.io.DataInputStream in) throws java.io.IOException
in
- The stream from which to read.
java.io.IOException
- If an error occurs while reading.public Method createMethod(java.io.DataInputStream in) throws java.io.IOException
java.io.IOException
public Field createField(java.io.DataInputStream in) throws java.io.IOException
java.io.IOException
public Attribute createAttribute(java.io.DataInputStream in, java.lang.String name, int nameIndex, int length) throws java.io.IOException
java.io.IOException
public Attribute[] getAttrs()
public Constant[] getConstants()
public Field[] getFields()
public polyglot.types.reflect.InnerClasses getInnerClasses()
public int[] getInterfaces()
public Method[] getMethods()
public int getModifiers()
public int getSuperClass()
public int getThisClass()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |