|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vostok.lang.classes.bytecode.RawClassDecoding
public class RawClassDecoding
rawClassDecoding decode informations for a class (such as class name, interfaces, runtime annotations...), from a binary stream, a file or an url without loading it.
Getting deeping into byte code is beyond the scope of this class, you should consider tools like asm, javassist or instance the class and use reflexion instead.
Note : build on jdk1.6, target up to jdk 1.7, future features might not be recognized
http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.1
Nested Class Summary | |
---|---|
protected class |
RawClassDecoding.Constant
internal use |
class |
RawClassDecoding.Field
describ a field for this class |
class |
RawClassDecoding.Method
describe a method signature for this class |
Constructor Summary | |
---|---|
RawClassDecoding(byte[] buffer)
construct a new RawClassDecoding using plain byte array for input data |
|
RawClassDecoding(java.io.File file)
construct a new RawClassDecoding using an file object to a .class file (file extension not mandatory, check done by magic number) |
|
RawClassDecoding(java.io.InputStream stream)
construct a new RawClassDecoding object, using an InputStream for data |
|
RawClassDecoding(java.lang.String path)
construct a new RawClassDecoding using an absolute path to a .class file (file extension not mandatory, check done by magic number) |
Method Summary | |
---|---|
int |
getAccess()
return access flag for this class |
java.lang.String[] |
getAnnotations()
return a simple list of class runtime annotation. can be empty but never null |
java.lang.String |
getBinaryClassName()
return the binary name this class would link to. |
RawClassDecoding.Field[] |
getFields()
return fields list, can be empty but neve null |
java.lang.String[] |
getInterfaces()
return the interface list this class implement. can be empty but never null |
int |
getMajorVersion()
return the major version number for this class |
RawClassDecoding.Method[] |
getMethods()
return methods list, can be empty but never null |
int |
getMinorVersion()
return the minor version for this class |
byte[] |
getRawData()
return raw data this decoder is using |
java.lang.String |
getSuperName()
return the binary name for the super class. |
void |
printDebug()
dump to System.out a description of the raw class data. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RawClassDecoding(byte[] buffer) throws java.lang.ClassFormatError, java.lang.NullPointerException
bu
-
java.lang.ClassFormatError
java.lang.NullPointerException
public RawClassDecoding(java.lang.String path) throws java.lang.ClassFormatError, java.lang.NullPointerException, java.io.FileNotFoundException, java.io.IOException
path
-
java.lang.ClassFormatError
java.lang.NullPointerException
java.io.FileNotFoundException
java.io.IOException
public RawClassDecoding(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
file
-
java.io.FileNotFoundException
java.io.IOException
public RawClassDecoding(java.io.InputStream stream) throws java.lang.ClassFormatError, java.lang.NullPointerException, java.io.IOException
stream
-
java.lang.ClassFormatError
java.lang.NullPointerException
java.io.IOException
Method Detail |
---|
public byte[] getRawData()
public int getMinorVersion()
public int getMajorVersion()
public int getAccess()
public java.lang.String getBinaryClassName()
ClassLoader
public java.lang.String getSuperName()
public java.lang.String[] getInterfaces()
public java.lang.String[] getAnnotations()
public RawClassDecoding.Field[] getFields()
public RawClassDecoding.Method[] getMethods()
public java.lang.String toString()
toString
in class java.lang.Object
public void printDebug()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |