public final class DeprecatedAttribute extends AttributeInfo
DeprecatedAttribute
denotes a Deprecated_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 Deprecated_attribute structure.
|
Modifier and Type | Method and Description |
---|---|
DeprecatedAttribute |
copy()
Returns a copy of this
DeprecatedAttribute instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of DeprecatedAttribute , and that DeprecatedAttribute instance is equal to this DeprecatedAttribute instance, false
otherwise. |
static java.util.List<DeprecatedAttribute> |
filter(Node node)
Returns a
List with all DeprecatedAttribute s. |
static java.util.Optional<DeprecatedAttribute> |
find(MethodInfo methodInfo)
Attempts to find a
DeprecatedAttribute instance in methodInfo . |
int |
getAttributeLength()
Returns the attribute_length of this
DeprecatedAttribute instance. |
int |
hashCode()
Returns a hash code for this
DeprecatedAttribute instance. |
static DeprecatedAttribute |
newInstance(int attributeNameIndex)
Returns a new
DeprecatedAttribute instance. |
java.lang.String |
toString()
Returns a
String representation of this DeprecatedAttribute instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
DeprecatedAttribute to dataOutput . |
getAttributeNameIndex, getName, setAttributeNameIndex
public static final java.lang.String NAME
public DeprecatedAttribute copy()
DeprecatedAttribute
instance.copy
in class AttributeInfo
DeprecatedAttribute
instancepublic java.lang.String toString()
String
representation of this DeprecatedAttribute
instance.toString
in class java.lang.Object
String
representation of this DeprecatedAttribute
instancepublic boolean equals(java.lang.Object object)
true
if, and only if, object
is an instance of DeprecatedAttribute
, and that DeprecatedAttribute
instance is equal to this DeprecatedAttribute
instance, false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this DeprecatedAttribute
instance for equalitytrue
if, and only if, object
is an instance of DeprecatedAttribute
, and that DeprecatedAttribute
instance is equal to this DeprecatedAttribute
instance, false
otherwisepublic int getAttributeLength()
DeprecatedAttribute
instance.getAttributeLength
in class AttributeInfo
DeprecatedAttribute
instancepublic int hashCode()
DeprecatedAttribute
instance.hashCode
in class java.lang.Object
DeprecatedAttribute
instancepublic void write(java.io.DataOutput dataOutput)
DeprecatedAttribute
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 DeprecatedAttribute newInstance(int attributeNameIndex)
DeprecatedAttribute
instance.
If attributeNameIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
attributeNameIndex
- the attribute_name_index of the new DeprecatedAttribute
instanceDeprecatedAttribute
instancejava.lang.IllegalArgumentException
- thrown if, and only if, attributeNameIndex
is less than or equal to 0
public static java.util.List<DeprecatedAttribute> filter(Node node)
List
with all DeprecatedAttribute
s.
All DeprecatedAttribute
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 DeprecatedAttribute
sjava.lang.NullPointerException
- thrown if, and only if, node
is null
public static java.util.Optional<DeprecatedAttribute> find(MethodInfo methodInfo)
DeprecatedAttribute
instance in methodInfo
.
Returns an Optional
with the optional DeprecatedAttribute
instance.
If methodInfo
is null
, a NullPointerException
will be thrown.
methodInfo
- the MethodInfo
to check inOptional
with the optional DeprecatedAttribute
instancejava.lang.NullPointerException
- thrown if, and only if, methodInfo
is null