public class AttributeFactory
extends java.lang.Object
Attribute subclasses
depending on the context and name.| Modifier and Type | Field and Description |
|---|---|
static int |
CTX_CLASS
context for attributes on class files
|
static int |
CTX_CODE
context for attributes on code attributes
|
static int |
CTX_COUNT
number of contexts
|
static int |
CTX_FIELD
context for attributes on fields
|
static int |
CTX_METHOD
context for attributes on methods
|
| Constructor and Description |
|---|
AttributeFactory()
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
Attribute |
parse(DirectClassFile cf,
int context,
int offset,
ParseObserver observer)
Parses and makes an attribute based on the bytes at the
indicated position in the given array.
|
protected Attribute |
parse0(DirectClassFile cf,
int context,
java.lang.String name,
int offset,
int length,
ParseObserver observer)
Parses attribute content.
|
public static final int CTX_CLASS
public static final int CTX_FIELD
public static final int CTX_METHOD
public static final int CTX_CODE
public static final int CTX_COUNT
public final Attribute parse(DirectClassFile cf, int context, int offset, ParseObserver observer)
parse0(com.android.dx.cf.direct.DirectClassFile, int, java.lang.String, int, int, com.android.dx.cf.iface.ParseObserver),
which does the actual construction.cf - non-null; class file to parse fromcontext - context to parse in; one of the CTX_*
constantsoffset - offset into dcf's bytes
to start parsing atobserver - null-ok; parse observer to report to, if anynon-null; an appropriately-constructed Attributeprotected Attribute parse0(DirectClassFile cf, int context, java.lang.String name, int offset, int length, ParseObserver observer)
RawAttribute. Subclasses are expected to
override this to do something better in most cases.cf - non-null; class file to parse fromcontext - context to parse in; one of the CTX_*
constantsname - non-null; the attribute nameoffset - offset into bytes to start parsing at; this
is the offset to the start of attribute data, not to the headerlength - the length of the attribute dataobserver - null-ok; parse observer to report to, if anynon-null; an appropriately-constructed AttributeCopyright © 2020. All Rights Reserved.