public final class EnclosingMethodAttribute extends AttributeInfo
EnclosingMethodAttribute
denotes an EnclosingMethod_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 EnclosingMethod_attribute structure.
|
Modifier and Type | Method and Description |
---|---|
EnclosingMethodAttribute |
copy()
Returns a copy of this
EnclosingMethodAttribute instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of EnclosingMethodAttribute , and that EnclosingMethodAttribute instance is equal to this EnclosingMethodAttribute instance,
false otherwise. |
static java.util.List<EnclosingMethodAttribute> |
filter(Node node)
Returns a
List with all EnclosingMethodAttribute s. |
int |
getAttributeLength()
Returns the attribute_length of this
EnclosingMethodAttribute instance. |
int |
getClassIndex()
Returns the class_index of this
EnclosingMethodAttribute instance. |
int |
getMethodIndex()
Returns the method_index of this
EnclosingMethodAttribute instance. |
int |
hashCode()
Returns a hash code for this
EnclosingMethodAttribute instance. |
static EnclosingMethodAttribute |
newInstance(int attributeNameIndex,
int classIndex,
int methodIndex)
Returns a new
EnclosingMethodAttribute instance. |
void |
setClassIndex(int classIndex)
Sets a new class_index for this
EnclosingMethodAttribute instance. |
void |
setMethodIndex(int methodIndex)
Sets a new method_index for this
EnclosingMethodAttribute instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
EnclosingMethodAttribute to dataOutput . |
getAttributeNameIndex, getName, setAttributeNameIndex
public static final java.lang.String NAME
public EnclosingMethodAttribute copy()
EnclosingMethodAttribute
instance.copy
in class AttributeInfo
EnclosingMethodAttribute
instancepublic boolean equals(java.lang.Object object)
true
if, and only if, object
is an instance of EnclosingMethodAttribute
, and that EnclosingMethodAttribute
instance is equal to this EnclosingMethodAttribute
instance,
false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this EnclosingMethodAttribute
instance for equalitytrue
if, and only if, object
is an instance of EnclosingMethodAttribute
, and that EnclosingMethodAttribute
instance is equal to this EnclosingMethodAttribute
instance,
false
otherwisepublic int getAttributeLength()
EnclosingMethodAttribute
instance.getAttributeLength
in class AttributeInfo
EnclosingMethodAttribute
instancepublic int getClassIndex()
EnclosingMethodAttribute
instance.EnclosingMethodAttribute
instancepublic int getMethodIndex()
EnclosingMethodAttribute
instance.EnclosingMethodAttribute
instancepublic int hashCode()
EnclosingMethodAttribute
instance.hashCode
in class java.lang.Object
EnclosingMethodAttribute
instancepublic void setClassIndex(int classIndex)
EnclosingMethodAttribute
instance.
If classIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
classIndex
- the new class_index for this EnclosingMethodAttribute
instancejava.lang.IllegalArgumentException
- thrown if, and only if, classIndex
is less than or equal to 0
public void setMethodIndex(int methodIndex)
EnclosingMethodAttribute
instance.
If methodIndex
is less than 0
, an IllegalArgumentException
will be thrown.
methodIndex
- the new method_index for this EnclosingMethodAttribute
instancejava.lang.IllegalArgumentException
- thrown if, and only if, methodIndex
is less than 0
public void write(java.io.DataOutput dataOutput)
EnclosingMethodAttribute
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 EnclosingMethodAttribute newInstance(int attributeNameIndex, int classIndex, int methodIndex)
EnclosingMethodAttribute
instance.
If either attributeNameIndex
or classIndex
are less than or equal to 0
, or methodIndex
is less than 0
, an IllegalArgumentException
will be thrown.
attributeNameIndex
- the attribute_name_index for the new EnclosingMethodAttribute
instanceclassIndex
- the class_index for the new EnclosingMethodAttribute
instancemethodIndex
- the method_index for the new EnclosingMethodAttribute
instanceEnclosingMethodAttribute
instancejava.lang.IllegalArgumentException
- thrown if, and only if, either attributeNameIndex
or classIndex
are less than or equal to 0
, or methodIndex
is less than 0
public static java.util.List<EnclosingMethodAttribute> filter(Node node)
List
with all EnclosingMethodAttribute
s.
All EnclosingMethodAttribute
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 EnclosingMethodAttribute
sjava.lang.NullPointerException
- thrown if, and only if, node
is null