public final class StackMapTableAttribute extends AttributeInfo
StackMapTableAttribute
denotes a StackMapTable_attribute structure somewhere in a ClassFile structure.
This class is not thread-safe.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME
The name of the StackMapTable_attribute structure.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(NodeHierarchicalVisitor nodeHierarchicalVisitor)
Accepts a
NodeHierarchicalVisitor . |
void |
addStackMapFrame(StackMapTableAttribute.StackMapFrame stackMapFrame)
Adds
stackMapFrame to this StackMapTableAttribute instance. |
StackMapTableAttribute |
copy()
Returns a copy of this
StackMapTableAttribute instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of StackMapTableAttribute , and that StackMapTableAttribute instance is equal to this StackMapTableAttribute instance,
false otherwise. |
static java.util.List<StackMapTableAttribute> |
filter(Node node)
Returns a
List with all StackMapTableAttribute s. |
int |
getAttributeLength()
Returns the attribute_length of this
StackMapTableAttribute instance. |
int |
getNumberOfStackMapFrames()
Returns the number_of_entries of this
StackMapTableAttribute instance. |
int |
hashCode()
Returns a hash code for this
StackMapTableAttribute instance. |
static StackMapTableAttribute |
newInstance(int attributeNameIndex)
Returns a new
StackMapTableAttribute instance. |
void |
removeStackMapFrame(StackMapTableAttribute.StackMapFrame stackMapFrame)
Attempts to remove
stackMapFrame from this StackMapTableAttribute instance. |
java.lang.String |
toString()
Returns a
String representation of this StackMapTableAttribute instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
StackMapTableAttribute to dataOutput . |
getAttributeNameIndex, getName, setAttributeNameIndex
public static final java.lang.String NAME
public StackMapTableAttribute copy()
StackMapTableAttribute
instance.copy
in class AttributeInfo
StackMapTableAttribute
instancepublic java.lang.String toString()
String
representation of this StackMapTableAttribute
instance.toString
in class java.lang.Object
String
representation of this StackMapTableAttribute
instancepublic boolean accept(NodeHierarchicalVisitor nodeHierarchicalVisitor)
NodeHierarchicalVisitor
.
Returns the result of nodeHierarchicalVisitor.visitLeave(this)
.
If nodeHierarchicalVisitor
is null
, a NullPointerException
will be thrown.
If a RuntimeException
is thrown by the current NodeHierarchicalVisitor
, a NodeTraversalException
will be thrown with the RuntimeException
wrapped.
This implementation will:
NullPointerException
if nodeHierarchicalVisitor
is null
.NodeTraversalException
if nodeHierarchicalVisitor
throws a RuntimeException
.Node
s, if it has any.nodeHierarchicalVisitor
- the NodeHierarchicalVisitor
to acceptnodeHierarchicalVisitor.visitLeave(this)
NodeTraversalException
- thrown if, and only if, a RuntimeException
is thrown by the current NodeHierarchicalVisitor
java.lang.NullPointerException
- thrown if, and only if, nodeHierarchicalVisitor
is null
public boolean equals(java.lang.Object object)
true
if, and only if, object
is an instance of StackMapTableAttribute
, and that StackMapTableAttribute
instance is equal to this StackMapTableAttribute
instance,
false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this StackMapTableAttribute
instance for equalitytrue
if, and only if, object
is an instance of StackMapTableAttribute
, and that StackMapTableAttribute
instance is equal to this StackMapTableAttribute
instance,
false
otherwisepublic int getAttributeLength()
StackMapTableAttribute
instance.getAttributeLength
in class AttributeInfo
StackMapTableAttribute
instancepublic int getNumberOfStackMapFrames()
StackMapTableAttribute
instance.StackMapTableAttribute
instancepublic int hashCode()
StackMapTableAttribute
instance.hashCode
in class java.lang.Object
StackMapTableAttribute
instancepublic void addStackMapFrame(StackMapTableAttribute.StackMapFrame stackMapFrame)
stackMapFrame
to this StackMapTableAttribute
instance.
If stackMapFrame
is null
, a NullPointerException
will be thrown.
stackMapFrame
- the StackMapFrame
to addjava.lang.NullPointerException
- thrown if, and only if, stackMapFrame
is null
public void removeStackMapFrame(StackMapTableAttribute.StackMapFrame stackMapFrame)
stackMapFrame
from this StackMapTableAttribute
instance.
If stackMapFrame
is null
, a NullPointerException
will be thrown.
If no StackMapFrame
equal to stackMapFrame
can be found, nothing will happen.
stackMapFrame
- the StackMapFrame
to removejava.lang.NullPointerException
- thrown if, and only if, stackMapFrame
is null
public void write(java.io.DataOutput dataOutput)
StackMapTableAttribute
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
will be thrown.
If an I/O-error occurs, an UncheckedIOException
will be thrown.
write
in class AttributeInfo
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 occurspublic static java.util.List<StackMapTableAttribute> filter(Node node)
List
with all StackMapTableAttribute
s.
All StackMapTableAttribute
s are found by traversing node
using a simple NodeHierarchicalVisitor
implementation.
If node
is null
, a NullPointerException
will be thrown.
node
- the Node
to start traversal fromList
with all StackMapTableAttribute
sjava.lang.NullPointerException
- thrown if, and only if, node
is null
public static StackMapTableAttribute newInstance(int attributeNameIndex)
StackMapTableAttribute
instance.
If attributeNameIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
attributeNameIndex
- the attribute_name_index of the new StackMapTableAttribute
instanceStackMapTableAttribute
instancejava.lang.IllegalArgumentException
- thrown if, and only if, attributeNameIndex
is less than or equal to 0