public abstract class Attribute extends Object
ClassFile
Modifier and Type | Field and Description |
---|---|
static String |
CODE |
static String |
CONSTANT_VALUE |
static String |
DEPRECATED |
static String |
ENCLOSING_METHOD |
static String |
EXCEPTIONS |
static String |
INNER_CLASSES |
static String |
LINE_NUMBER_TABLE |
static String |
LOCAL_VARIABLE_TABLE |
static String |
RUNTIME_INVISIBLE_ANNOTATIONS |
static String |
RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS |
static String |
RUNTIME_VISIBLE_ANNOTATIONS |
static String |
RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS |
static String |
SIGNATURE |
static String |
SOURCE_FILE |
static String |
STACK_MAP_TABLE |
static String |
SYNTHETIC |
Modifier | Constructor and Description |
---|---|
protected |
Attribute(ConstantPool cp,
String name) |
Modifier and Type | Method and Description |
---|---|
Attribute[] |
getAttributes()
Some attributes have sub-attributes.
|
ConstantPool |
getConstantPool()
Returns the ConstantPool that this attribute is defined against.
|
abstract int |
getLength()
Returns the length (in bytes) of this attribute in the class file.
|
String |
getName()
Returns the name of this attribute.
|
ConstantUTFInfo |
getNameConstant() |
static Attribute |
readFrom(ConstantPool cp,
DataInput din,
AttributeFactory attrFactory) |
protected static boolean |
skipBytes(DataInput din,
int amount) |
void |
writeDataTo(DataOutput dout)
Write just the attribute specific data.
|
void |
writeTo(DataOutput dout)
This method writes the 16 bit name constant index followed by the
32 bit attribute length, followed by the attribute specific data.
|
public static final String CODE
public static final String CONSTANT_VALUE
public static final String DEPRECATED
public static final String EXCEPTIONS
public static final String INNER_CLASSES
public static final String LINE_NUMBER_TABLE
public static final String LOCAL_VARIABLE_TABLE
public static final String SOURCE_FILE
public static final String SYNTHETIC
public static final String SIGNATURE
public static final String ENCLOSING_METHOD
public static final String RUNTIME_VISIBLE_ANNOTATIONS
public static final String RUNTIME_INVISIBLE_ANNOTATIONS
public static final String RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS
public static final String RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS
public static final String STACK_MAP_TABLE
protected Attribute(ConstantPool cp, String name)
public ConstantPool getConstantPool()
public String getName()
public ConstantUTFInfo getNameConstant()
public Attribute[] getAttributes()
public abstract int getLength()
public void writeTo(DataOutput dout) throws IOException
IOException
public void writeDataTo(DataOutput dout) throws IOException
IOException
public static Attribute readFrom(ConstantPool cp, DataInput din, AttributeFactory attrFactory) throws IOException
attrFactory
- optional factory for reading custom attributesIOException
protected static boolean skipBytes(DataInput din, int amount) throws IOException
IOException
Copyright © 2004-2015 Cojen. All Rights Reserved.