public abstract class AttributeInfo extends java.lang.Object implements Node
AttributeInfo
denotes an attribute_info structure somewhere in a ClassFile structure.
This class is not thread-safe.
Modifier | Constructor and Description |
---|---|
protected |
AttributeInfo(java.lang.String name,
int attributeNameIndex)
Constructs a new
AttributeInfo instance. |
Modifier and Type | Method and Description |
---|---|
abstract AttributeInfo |
copy()
Returns a copy of this
AttributeInfo instance. |
abstract int |
getAttributeLength()
Returns the attribute_length of this
AttributeInfo instance. |
int |
getAttributeNameIndex()
Returns the attribute_name_index of this
AttributeInfo instance. |
java.lang.String |
getName()
Returns the name of this
AttributeInfo instance. |
void |
setAttributeNameIndex(int attributeNameIndex)
Sets the attribute_name_index for this
AttributeInfo instance. |
abstract void |
write(java.io.DataOutput dataOutput)
Writes this
AttributeInfo to dataOutput . |
protected AttributeInfo(java.lang.String name, int attributeNameIndex)
AttributeInfo
instance.
If name
is null
, a NullPointerException
will be thrown.
If attributeNameIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
name
- the name of this AttributeInfo
instanceattributeNameIndex
- the attribute_name_index of this AttributeInfo
instancejava.lang.IllegalArgumentException
- thrown if, and only if, attributeNameIndex
is less than or equal to 0
java.lang.NullPointerException
- thrown if, and only if, name
is null
public abstract AttributeInfo copy()
AttributeInfo
instance.AttributeInfo
instancepublic final java.lang.String getName()
AttributeInfo
instance.AttributeInfo
instancepublic abstract int getAttributeLength()
AttributeInfo
instance.AttributeInfo
instancepublic final int getAttributeNameIndex()
AttributeInfo
instance.AttributeInfo
instancepublic final void setAttributeNameIndex(int attributeNameIndex)
AttributeInfo
instance.
If attributeNameIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
attributeNameIndex
- the new attribute_name_indexjava.lang.IllegalArgumentException
- thrown if, and only if, attributeNameIndex
is less than or equal to 0
public abstract void write(java.io.DataOutput dataOutput)
AttributeInfo
to dataOutput
.
If dataOutput
is an OutputStream
(or any other type of stream), this method will not close it.
If dataOutput
is null
, a NullPointerException
may be thrown. But no guarantees can be made.
If an I/O-error occurs, an UncheckedIOException
may be thrown. But no guarantees can be made.
dataOutput
- the DataOutput
to write tojava.lang.NullPointerException
- thrown if, and only if, dataOutput
is null
java.io.UncheckedIOException
- thrown if, and only if, an I/O-error occurs