public final class RuntimeInvisibleAnnotationsAttribute extends AttributeInfo
RuntimeInvisibleAnnotationsAttribute
denotes a RuntimeInvisibleAnnotations_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 RuntimeInvisibleAnnotations_attribute structure.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(NodeHierarchicalVisitor nodeHierarchicalVisitor)
Accepts a
NodeHierarchicalVisitor . |
void |
addAnnotation(Annotations.Annotation annotation)
Adds
annotation to the annotations of this RuntimeInvisibleAnnotationsAttribute instance. |
RuntimeInvisibleAnnotationsAttribute |
copy()
Returns a copy of this
RuntimeInvisibleAnnotationsAttribute instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of RuntimeInvisibleAnnotationsAttribute , and that RuntimeInvisibleAnnotationsAttribute instance is equal to this
RuntimeInvisibleAnnotationsAttribute instance, false otherwise. |
static java.util.List<RuntimeInvisibleAnnotationsAttribute> |
filter(Node node)
Returns a
List with all RuntimeInvisibleAnnotationsAttribute s. |
java.util.List<Annotations.Annotation> |
getAnnotations()
Returns the annotations of this
RuntimeInvisibleAnnotationsAttribute instance. |
int |
getAttributeLength()
Returns the attribute_length of this
RuntimeInvisibleAnnotationsAttribute instance. |
int |
getNumAnnotations()
Returns the num_annotations of this
RuntimeInvisibleAnnotationsAttribute instance. |
int |
hashCode()
Returns a hash code for this
RuntimeInvisibleAnnotationsAttribute instance. |
static RuntimeInvisibleAnnotationsAttribute |
newInstance(int attributeNameIndex)
Returns a new
RuntimeInvisibleAnnotationsAttribute instance. |
void |
removeAnnotation(Annotations.Annotation annotation)
Removes
annotation from the annotations of this RuntimeInvisibleAnnotationsAttribute instance. |
java.lang.String |
toString()
Returns a
String representation of this RuntimeInvisibleAnnotationsAttribute instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
RuntimeInvisibleAnnotationsAttribute to dataOutput . |
getAttributeNameIndex, getName, setAttributeNameIndex
public static final java.lang.String NAME
public java.util.List<Annotations.Annotation> getAnnotations()
RuntimeInvisibleAnnotationsAttribute
instance.
Modifying the returned List
will not affect this RuntimeInvisibleAnnotationsAttribute
instance.
RuntimeInvisibleAnnotationsAttribute
instancepublic RuntimeInvisibleAnnotationsAttribute copy()
RuntimeInvisibleAnnotationsAttribute
instance.copy
in class AttributeInfo
RuntimeInvisibleAnnotationsAttribute
instancepublic java.lang.String toString()
String
representation of this RuntimeInvisibleAnnotationsAttribute
instance.toString
in class java.lang.Object
String
representation of this RuntimeInvisibleAnnotationsAttribute
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 RuntimeInvisibleAnnotationsAttribute
, and that RuntimeInvisibleAnnotationsAttribute
instance is equal to this
RuntimeInvisibleAnnotationsAttribute
instance, false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this RuntimeInvisibleAnnotationsAttribute
instance for equalitytrue
if, and only if, object
is an instance of RuntimeInvisibleAnnotationsAttribute
, and that RuntimeInvisibleAnnotationsAttribute
instance is equal to this
RuntimeInvisibleAnnotationsAttribute
instance, false
otherwisepublic int getAttributeLength()
RuntimeInvisibleAnnotationsAttribute
instance.getAttributeLength
in class AttributeInfo
RuntimeInvisibleAnnotationsAttribute
instancepublic int getNumAnnotations()
RuntimeInvisibleAnnotationsAttribute
instance.RuntimeInvisibleAnnotationsAttribute
instancepublic int hashCode()
RuntimeInvisibleAnnotationsAttribute
instance.hashCode
in class java.lang.Object
RuntimeInvisibleAnnotationsAttribute
instancepublic void addAnnotation(Annotations.Annotation annotation)
annotation
to the annotations of this RuntimeInvisibleAnnotationsAttribute
instance.
If annotation
is null
, a NullPointerException
will be thrown.
annotation
- the Annotations.Annotation
to addjava.lang.NullPointerException
- thrown if, and only if, annotation
is null
public void removeAnnotation(Annotations.Annotation annotation)
annotation
from the annotations of this RuntimeInvisibleAnnotationsAttribute
instance.
If annotation
is null
, a NullPointerException
will be thrown.
annotation
- the Annotations.Annotation
to removejava.lang.NullPointerException
- thrown if, and only if, annotation
is null
public void write(java.io.DataOutput dataOutput)
RuntimeInvisibleAnnotationsAttribute
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<RuntimeInvisibleAnnotationsAttribute> filter(Node node)
List
with all RuntimeInvisibleAnnotationsAttribute
s.
All RuntimeInvisibleAnnotationsAttribute
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 RuntimeInvisibleAnnotationsAttribute
sjava.lang.NullPointerException
- thrown if, and only if, node
is null
public static RuntimeInvisibleAnnotationsAttribute newInstance(int attributeNameIndex)
RuntimeInvisibleAnnotationsAttribute
instance.
If attributeNameIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
attributeNameIndex
- the attribute_name_index of the new RuntimeInvisibleAnnotationsAttribute
instanceRuntimeInvisibleAnnotationsAttribute
instancejava.lang.IllegalArgumentException
- thrown if, and only if, attributeNameIndex
is less than or equal to 0