public abstract class Attribute
extends java.lang.Object
Various sub-classses are used for standard attributes, or you can use MiscAttr for a generic attribute.
Constructor and Description |
---|
Attribute(java.lang.String name)
Create a new Attribute.
|
Modifier and Type | Method and Description |
---|---|
void |
addToFrontOf(AttrContainer container)
Add this to (the front of) of the specified attribute container.
|
static void |
assignConstants(AttrContainer container,
ClassType cl)
Add any needed constant pool entries for all attributes in a container.
|
void |
assignConstants(ClassType cl)
Add any needed constant pool entries for this Attribute.
|
static int |
count(AttrContainer container) |
static Attribute |
get(AttrContainer container,
java.lang.String name)
Find an Attribute by name, in an attribute cointainer.
|
ConstantPool |
getConstants() |
AttrContainer |
getContainer()
Return the Attribute container that contains this Attribute.
|
abstract int |
getLength()
Return the length of the attribute in bytes.
|
static int |
getLengthAll(AttrContainer container)
Return the length of all the attributes (with headers) in bytes.
|
java.lang.String |
getName() |
int |
getNameIndex() |
Attribute |
getNext()
Get the next Attribute belonging to getContainer().
|
boolean |
isSkipped()
Returns true if this attribute should be skipped on output.
|
void |
print(ClassTypeWriter dst) |
void |
setContainer(AttrContainer container) |
void |
setName(java.lang.String name) |
void |
setNameIndex(int index) |
void |
setNext(Attribute next)
Set the next Attribute in the chain belonging to getContainer().
|
void |
setSkipped()
Cause this attributed to be skipped on output.
|
void |
setSkipped(boolean skip)
Iff skip, cause this attributed to be skipped on output.
|
abstract void |
write(java.io.DataOutputStream dstr)
Write out the contents of the Attribute.
|
static void |
writeAll(AttrContainer container,
java.io.DataOutputStream dstr) |
public Attribute(java.lang.String name)
name
- - an interned String that names the Attribute.public final AttrContainer getContainer()
public final void setContainer(AttrContainer container)
public final Attribute getNext()
public final void setNext(Attribute next)
public ConstantPool getConstants()
public void addToFrontOf(AttrContainer container)
public final boolean isSkipped()
public final void setSkipped(boolean skip)
public final void setSkipped()
public final java.lang.String getName()
public final void setName(java.lang.String name)
public final int getNameIndex()
public final void setNameIndex(int index)
public static Attribute get(AttrContainer container, java.lang.String name)
container
- the attribute container to searchname
- the (interned) name of the attribute we are seekingpublic void assignConstants(ClassType cl)
public static void assignConstants(AttrContainer container, ClassType cl)
public abstract int getLength()
public static int getLengthAll(AttrContainer container)
public abstract void write(java.io.DataOutputStream dstr) throws java.io.IOException
java.io.IOException
public static int count(AttrContainer container)
public static void writeAll(AttrContainer container, java.io.DataOutputStream dstr) throws java.io.IOException
java.io.IOException
public void print(ClassTypeWriter dst)