|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.deltax.util.CPoolReader
This class reads directly a class file as specified in the Java Language
specification.
Unfortunately java.lang.ClassLoader does not provide
services for accessing class bytecode, so a ClassFileFinder object is used
to locate and load the bytecode for a class.
Generally this scheme must
be identical to the currently used ClassLoader scheme.
A JDK 1.2
ClassFileFinder - which emulates standard JDK 1.2 behaviour is used by
default, but a different ClassFileFinder can be specified at construction
time.
JDK12ClassFileFinder
Nested Class Summary | |
class |
CPoolReader.attribute_info
|
class |
CPoolReader.C_Class
|
class |
CPoolReader.C_Double
|
class |
CPoolReader.C_Fieldref
|
class |
CPoolReader.C_Float
|
class |
CPoolReader.C_FMIRefBase
Base for CONSTANT_Fieldref, CONSTANT_Methodref, CONSTANT_InterfaceMethodref entries |
class |
CPoolReader.C_IFBase
|
class |
CPoolReader.C_Integer
|
class |
CPoolReader.C_InterfaceMethodref
|
class |
CPoolReader.C_LDBase
|
class |
CPoolReader.C_Long
|
class |
CPoolReader.C_Methodref
|
class |
CPoolReader.C_NameAndType
|
class |
CPoolReader.C_String
|
class |
CPoolReader.C_Utf8
|
class |
CPoolReader.classfile
This class mirrors exactly the class file structure, providing basic translation and filtering services. |
class |
CPoolReader.cp_info
The basic cp_info class. |
class |
CPoolReader.field_info
|
class |
CPoolReader.method_info
|
class |
CPoolReader.MF_info
|
class |
CPoolReader.unknown_cp_info
An helper class used for internal debugging only |
Field Summary | |
static short |
ACC_ABSTRACT
|
static java.lang.String |
ACC_ABSTRACT_s
|
static short |
ACC_FINAL
|
static java.lang.String |
ACC_FINAL_s
|
static short |
ACC_INTERFACE
|
static java.lang.String |
ACC_INTERFACE_s
|
static short |
ACC_NATIVE
|
static java.lang.String |
ACC_NATIVE_s
|
static short |
ACC_PRIVATE
|
static java.lang.String |
ACC_PRIVATE_s
|
static short |
ACC_PROTECTED
|
static java.lang.String |
ACC_PROTECTED_s
|
static short |
ACC_PUBLIC
|
static java.lang.String |
ACC_PUBLIC_s
|
static short |
ACC_STATIC
|
static java.lang.String |
ACC_STATIC_s
|
static short |
ACC_SYNCHRONIZED
|
static java.lang.String |
ACC_SYNCHRONIZED_s
|
static short |
ACC_TRANSIENT
|
static java.lang.String |
ACC_TRANSIENT_s
|
static short |
ACC_VOLATILE
|
static java.lang.String |
ACC_VOLATILE_s
|
protected ClassFileFinder |
cff
The ClassFileFinder object used to locate bytecode By default, a plain JDK12ClassFileFinder. |
static byte |
CONSTANT_Class
|
static java.lang.String |
CONSTANT_Class_s
|
static byte |
CONSTANT_Double
|
static java.lang.String |
CONSTANT_Double_s
|
static byte |
CONSTANT_Fieldref
|
static java.lang.String |
CONSTANT_Fieldref_s
|
static byte |
CONSTANT_Float
|
static java.lang.String |
CONSTANT_Float_s
|
static byte |
CONSTANT_Integer
|
static java.lang.String |
CONSTANT_Integer_s
|
static byte |
CONSTANT_InterfaceMethodref
|
static java.lang.String |
CONSTANT_InterfaceMethodref_s
|
static byte |
CONSTANT_Long
|
static java.lang.String |
CONSTANT_Long_s
|
static byte |
CONSTANT_Methodref
|
static java.lang.String |
CONSTANT_Methodref_s
|
static byte |
CONSTANT_NameAndType
|
static java.lang.String |
CONSTANT_NamedType_s
|
static byte |
CONSTANT_String
|
static java.lang.String |
CONSTANT_String_s
|
static byte |
CONSTANT_Unknown
|
static java.lang.String |
CONSTANT_Unknown_s
|
static byte |
CONSTANT_Utf8
|
static java.lang.String |
CONSTANT_Utf8_s
|
Constructor Summary | |
CPoolReader()
Buids a CPoolReader which uses a JDK12ClassFileFinder |
|
CPoolReader(ClassFileFinder cff)
Buids a CPoolReader which uses the specifies ClassFileFinder |
|
CPoolReader(java.lang.String classPath)
Buids a CPoolReader which uses a JDK12 with the given application class path |
Method Summary | |
boolean |
forNameCalled(java.lang.String name)
This method detects the presence of "Class.forName()" call in this classfile. |
static java.lang.String |
getAcc_s(short access_flag)
|
static java.lang.String |
getConstTag_s(short tag)
|
java.lang.String[] |
getUsedClasses(java.lang.String name)
Retrieve the classes known to this .class file Note: The classes are returned in external form Refer to class description for finding/loading scheme discussion |
static void |
main(java.lang.String[] args)
|
CPoolReader.classfile |
readClass(java.lang.String className)
This returns an interpreted class file. |
CPoolReader.classfile |
readClassData(byte[] data)
|
CPoolReader.classfile |
readClassData(java.io.InputStream is)
|
CPoolReader.classfile |
readClassData(java.lang.String className,
java.io.InputStream is)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte CONSTANT_Class
public static final byte CONSTANT_Fieldref
public static final byte CONSTANT_Methodref
public static final byte CONSTANT_InterfaceMethodref
public static final byte CONSTANT_String
public static final byte CONSTANT_Integer
public static final byte CONSTANT_Float
public static final byte CONSTANT_Long
public static final byte CONSTANT_Double
public static final byte CONSTANT_NameAndType
public static final byte CONSTANT_Utf8
public static final byte CONSTANT_Unknown
public static final java.lang.String CONSTANT_Class_s
public static final java.lang.String CONSTANT_Fieldref_s
public static final java.lang.String CONSTANT_Methodref_s
public static final java.lang.String CONSTANT_InterfaceMethodref_s
public static final java.lang.String CONSTANT_String_s
public static final java.lang.String CONSTANT_Integer_s
public static final java.lang.String CONSTANT_Float_s
public static final java.lang.String CONSTANT_Long_s
public static final java.lang.String CONSTANT_Double_s
public static final java.lang.String CONSTANT_NamedType_s
public static final java.lang.String CONSTANT_Utf8_s
public static final java.lang.String CONSTANT_Unknown_s
public static final short ACC_PUBLIC
public static final short ACC_PRIVATE
public static final short ACC_PROTECTED
public static final short ACC_STATIC
public static final short ACC_FINAL
public static final short ACC_VOLATILE
public static final short ACC_TRANSIENT
public static final short ACC_SYNCHRONIZED
public static final short ACC_NATIVE
public static final short ACC_ABSTRACT
public static final short ACC_INTERFACE
public static final java.lang.String ACC_PUBLIC_s
public static final java.lang.String ACC_PRIVATE_s
public static final java.lang.String ACC_PROTECTED_s
public static final java.lang.String ACC_STATIC_s
public static final java.lang.String ACC_FINAL_s
public static final java.lang.String ACC_VOLATILE_s
public static final java.lang.String ACC_TRANSIENT_s
public static final java.lang.String ACC_SYNCHRONIZED_s
public static final java.lang.String ACC_NATIVE_s
public static final java.lang.String ACC_ABSTRACT_s
public static final java.lang.String ACC_INTERFACE_s
protected ClassFileFinder cff
Constructor Detail |
public CPoolReader()
public CPoolReader(java.lang.String classPath)
classPath
- the application class path to usepublic CPoolReader(ClassFileFinder cff)
cff
- the ClassFileFinder to use for locating class bytecodeMethod Detail |
public static java.lang.String getConstTag_s(short tag)
public static java.lang.String getAcc_s(short access_flag)
public CPoolReader.classfile readClass(java.lang.String className) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
- if an I/O Exception occurs reading the class file
java.lang.ClassNotFoundException
- if the class is not foundpublic CPoolReader.classfile readClassData(java.lang.String className, java.io.InputStream is) throws java.io.IOException
java.io.IOException
public CPoolReader.classfile readClassData(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public CPoolReader.classfile readClassData(byte[] data) throws java.io.IOException
java.io.IOException
public java.lang.String[] getUsedClasses(java.lang.String name) throws java.io.IOException, java.lang.ClassNotFoundException
Refer to class description for finding/loading scheme discussion
java.io.IOException
java.lang.ClassNotFoundException
public boolean forNameCalled(java.lang.String name) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |