|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.cf.direct.DirectClassFile
public class DirectClassFile
Class file with info taken from a byte[] or slice thereof.
| Constructor Summary | |
|---|---|
DirectClassFile(byte[] bytes,
String filePath,
boolean strictParse)
Constructs an instance. |
|
DirectClassFile(ByteArray bytes,
String filePath,
boolean strictParse)
Constructs an instance. |
|
| Method Summary | |
|---|---|
int |
getAccessFlags()
Gets the field access_flags. |
AttributeList |
getAttributes()
Gets the field attributes (along with
attributes_count). |
ByteArray |
getBytes()
Gets the ByteArray that this instance's data comes from. |
ConstantPool |
getConstantPool()
Gets the field constant_pool (along with
constant_pool_count). |
FieldList |
getFields()
Gets the field fields (along with
fields_count). |
String |
getFilePath()
Gets the path where this class file is located. |
TypeList |
getInterfaces()
Gets the field interfaces (along with
interfaces_count). |
int |
getMagic()
Gets the field magic. |
int |
getMagic0()
Gets the class file field magic, but without doing any
checks or parsing first. |
int |
getMajorVersion()
Gets the field major_version. |
int |
getMajorVersion0()
Gets the class file field major_version, but
without doing any checks or parsing first. |
MethodList |
getMethods()
Gets the field methods (along with
methods_count). |
int |
getMinorVersion()
Gets the field minor_version. |
int |
getMinorVersion0()
Gets the class file field minor_version, but
without doing any checks or parsing first. |
CstString |
getSourceFile()
Gets the name out of the SourceFile attribute of this
file, if any. |
CstType |
getSuperclass()
Gets the field super_class, interpreted as a type constant
if non-zero. |
CstType |
getThisClass()
Gets the field this_class, interpreted as a type constant. |
TypeList |
makeTypeList(int offset,
int size)
Constructs and returns an instance of TypeList whose
data comes from the bytes of this instance, interpreted as a
list of constant pool indices for classes, which are in turn
translated to type constants. |
void |
setAttributeFactory(AttributeFactory attributeFactory)
Sets the attribute factory to use. |
void |
setObserver(ParseObserver observer)
Sets the parse observer for this instance. |
static String |
stringOrNone(Object obj)
Returns the string form of an object or "(none)"
(rather than "null") for null. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DirectClassFile(ByteArray bytes,
String filePath,
boolean strictParse)
bytes - non-null; the bytes of the filefilePath - non-null; the file path for the class,
excluding any base directory specificationstrictParse - whether to be strict about parsing; if
false, this avoids doing checks that only exist
for purposes of verification (such as magic number matching and
path-package consistency checking)
public DirectClassFile(byte[] bytes,
String filePath,
boolean strictParse)
bytes - non-null; the bytes of the filefilePath - non-null; the file path for the class,
excluding any base directory specificationstrictParse - whether to be strict about parsing; if
false, this avoids doing checks that only exist
for purposes of verification (such as magic number matching and
path-package consistency checking)| Method Detail |
|---|
public static String stringOrNone(Object obj)
"(none)"
(rather than "null") for null.
obj - null-ok; the object to stringify
non-null; the appropriate string formpublic void setObserver(ParseObserver observer)
observer - null-ok; the observerpublic void setAttributeFactory(AttributeFactory attributeFactory)
attributeFactory - non-null; the attribute factorypublic String getFilePath()
non-null; the filePathpublic ByteArray getBytes()
ByteArray that this instance's data comes from.
non-null; the bytespublic int getMagic()
magic.
getMagic in interface ClassFilepublic int getMinorVersion()
minor_version.
getMinorVersion in interface ClassFilepublic int getMajorVersion()
major_version.
getMajorVersion in interface ClassFilepublic int getAccessFlags()
access_flags.
getAccessFlags in interface ClassFilepublic CstType getThisClass()
this_class, interpreted as a type constant.
getThisClass in interface ClassFilenon-null; the value in questionpublic CstType getSuperclass()
super_class, interpreted as a type constant
if non-zero.
getSuperclass in interface ClassFilenull-ok; the value in questionpublic ConstantPool getConstantPool()
constant_pool (along with
constant_pool_count).
getConstantPool in interface ClassFilenon-null; the constant poolpublic TypeList getInterfaces()
interfaces (along with
interfaces_count).
getInterfaces in interface ClassFilenon-null; the list of interfacespublic FieldList getFields()
fields (along with
fields_count).
getFields in interface ClassFilenon-null; the list of fieldspublic MethodList getMethods()
methods (along with
methods_count).
getMethods in interface ClassFilenon-null; the list of fieldspublic AttributeList getAttributes()
attributes (along with
attributes_count).
getAttributes in interface ClassFilenon-null; the list of attributespublic CstString getSourceFile()
SourceFile attribute of this
file, if any. This is a convenient shorthand for scrounging around
the class's attributes.
getSourceFile in interface ClassFilenon-null; the constant pool
public TypeList makeTypeList(int offset,
int size)
TypeList whose
data comes from the bytes of this instance, interpreted as a
list of constant pool indices for classes, which are in turn
translated to type constants. Instance construction will fail
if any of the (alleged) indices turn out not to refer to
constant pool entries of type Class.
offset - offset into bytes for the start of the
datasize - number of elements in the list (not number of bytes)
non-null; an appropriately-constructed class listpublic int getMagic0()
magic, but without doing any
checks or parsing first.
public int getMinorVersion0()
minor_version, but
without doing any checks or parsing first.
public int getMajorVersion0()
major_version, but
without doing any checks or parsing first.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||