abstract class Attribute
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CODE
Code attribute name.
|
protected static java.lang.String |
CONSTANTVALUE
ConstantValue attribute name.
|
protected static java.lang.String |
DEPRECATED
Deprecated attribute name.
|
protected static java.lang.String |
EXCEPTIONS
Exceptions attribute name.
|
protected static java.lang.String |
INNERCLASS
InnerClass attribute name.
|
protected static java.lang.String |
LINENUMBERTABLE
LineNumberTable attribute name.
|
protected static java.lang.String |
LOCALVARIABLETABLE
LocalVariableTable attribute name.
|
private Utf8Constant |
nameConstant
Type name of the current attribute.
|
protected static java.lang.String |
SOURCEFILE
SourceFile attribute name.
|
protected static java.lang.String |
SYNTHETIC
Synthetic attribute name.
|
Modifier | Constructor and Description |
---|---|
protected |
Attribute(ConstantPool pool,
java.lang.String type)
Create a new instance of this class, given a string indicating the
attribute type.
|
Modifier and Type | Method and Description |
---|---|
protected abstract int |
getLength()
This method must be implemented to return the total number of bytes
in the subclass attribute structure.
|
(package private) void |
write(java.io.DataOutput out)
This method writes the data for this attribute to the specified
output stream.
|
protected abstract void |
writeContent(java.io.DataOutput out)
This method must be implemented to write the data content (not
including the header info - type and length) for the subclassed
attribute type.
|
protected static final java.lang.String CONSTANTVALUE
protected static final java.lang.String CODE
protected static final java.lang.String EXCEPTIONS
protected static final java.lang.String INNERCLASS
protected static final java.lang.String SYNTHETIC
protected static final java.lang.String SOURCEFILE
protected static final java.lang.String LINENUMBERTABLE
protected static final java.lang.String LOCALVARIABLETABLE
protected static final java.lang.String DEPRECATED
private Utf8Constant nameConstant
protected Attribute(ConstantPool pool, java.lang.String type)
pool
- Constant pool from which to retrieve the Utf8Constant which
represents the name of the attribute.type
- One of the attribute type name constants defined by this
class.protected abstract int getLength()
void write(java.io.DataOutput out) throws java.io.IOException
writeContent()
is invoked to
write the subclass-specific data.out
- Output stream to which data is written.java.io.IOException
- If any error is encountered while writing data.protected abstract void writeContent(java.io.DataOutput out) throws java.io.IOException
out
- Output stream to which data content is written.java.io.IOException
- If any error is encountered while writing data.