public final class LocalVariableTypeTableAttribute extends AttributeInfo
LocalVariableTypeTableAttribute
denotes a LocalVariableTypeTable_attribute structure somewhere in a ClassFile structure.
This class is not thread-safe.
Modifier and Type | Class and Description |
---|---|
static class |
LocalVariableTypeTableAttribute.LocalVariableType
A
LocalVariableType denotes a local_variable_type structure somewhere in a LocalVariableTypeTable_attribute structure. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME
The name of the LocalVariableTypeTable_attribute structure.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(NodeHierarchicalVisitor nodeHierarchicalVisitor)
Accepts a
NodeHierarchicalVisitor . |
void |
addLocalVariableType(LocalVariableTypeTableAttribute.LocalVariableType localVariableType)
Adds
localVariableType to this LocalVariableTypeTableAttribute instance. |
LocalVariableTypeTableAttribute |
copy()
Returns a copy of this
LocalVariableTypeTableAttribute instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of LocalVariableTypeTableAttribute , and that LocalVariableTypeTableAttribute instance is equal to this
LocalVariableTypeTableAttribute instance, false otherwise. |
static java.util.List<LocalVariableTypeTableAttribute> |
filter(Node node)
Returns a
List with all LocalVariableTypeTableAttribute s. |
int |
getAttributeLength()
Returns the attribute_length of this
LocalVariableTypeTableAttribute instance. |
java.util.List<LocalVariableTypeTableAttribute.LocalVariableType> |
getLocalVariableTypeTable()
Returns a
List with all currently added LocalVariableType s. |
int |
getLocalVariableTypeTableLength()
Returns the local_variable_type_table_length of this
LocalVariableTypeTableAttribute instance. |
int |
hashCode()
Returns a hash code for this
LocalVariableTypeTableAttribute instance. |
static LocalVariableTypeTableAttribute |
newInstance(int attributeNameIndex)
Returns a new
LocalVariableTypeTableAttribute instance. |
void |
removeLocalVariableType(LocalVariableTypeTableAttribute.LocalVariableType localVariableType)
Removes
localVariableType from this LocalVariableTypeTableAttribute instance. |
java.lang.String |
toString()
Returns a
String representation of this LocalVariableTypeTableAttribute instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
LocalVariableTypeTableAttribute to dataOutput . |
getAttributeNameIndex, getName, setAttributeNameIndex
public static final java.lang.String NAME
public java.util.List<LocalVariableTypeTableAttribute.LocalVariableType> getLocalVariableTypeTable()
List
with all currently added LocalVariableType
s.
Modifying the returned List
will not affect this LocalVariableTypeTableAttribute
instance.
List
with all currently added LocalVariableType
spublic LocalVariableTypeTableAttribute copy()
LocalVariableTypeTableAttribute
instance.copy
in class AttributeInfo
LocalVariableTypeTableAttribute
instancepublic java.lang.String toString()
String
representation of this LocalVariableTypeTableAttribute
instance.toString
in class java.lang.Object
String
representation of this LocalVariableTypeTableAttribute
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 LocalVariableTypeTableAttribute
, and that LocalVariableTypeTableAttribute
instance is equal to this
LocalVariableTypeTableAttribute
instance, false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this LocalVariableTypeTableAttribute
instance for equalitytrue
if, and only if, object
is an instance of LocalVariableTypeTableAttribute
, and that LocalVariableTypeTableAttribute
instance is equal to this
LocalVariableTypeTableAttribute
instance, false
otherwisepublic int getAttributeLength()
LocalVariableTypeTableAttribute
instance.getAttributeLength
in class AttributeInfo
LocalVariableTypeTableAttribute
instance.public int getLocalVariableTypeTableLength()
LocalVariableTypeTableAttribute
instance.LocalVariableTypeTableAttribute
instance.public int hashCode()
LocalVariableTypeTableAttribute
instance.hashCode
in class java.lang.Object
LocalVariableTypeTableAttribute
instancepublic void addLocalVariableType(LocalVariableTypeTableAttribute.LocalVariableType localVariableType)
localVariableType
to this LocalVariableTypeTableAttribute
instance.
If localVariableType
is null
, a NullPointerException
will be thrown.
localVariableType
- the LocalVariableTypeTableAttribute.LocalVariableType
to addpublic void removeLocalVariableType(LocalVariableTypeTableAttribute.LocalVariableType localVariableType)
localVariableType
from this LocalVariableTypeTableAttribute
instance.
If localVariableType
is null
, a NullPointerException
will be thrown.
localVariableType
- the LocalVariableTypeTableAttribute.LocalVariableType
to removepublic void write(java.io.DataOutput dataOutput)
LocalVariableTypeTableAttribute
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<LocalVariableTypeTableAttribute> filter(Node node)
List
with all LocalVariableTypeTableAttribute
s.
All LocalVariableTypeTableAttribute
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 LocalVariableTypeTableAttribute
sjava.lang.NullPointerException
- thrown if, and only if, node
is null
public static LocalVariableTypeTableAttribute newInstance(int attributeNameIndex)
LocalVariableTypeTableAttribute
instance.
If attributeNameIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
attributeNameIndex
- the attribute_name_index of the new LocalVariableTypeTableAttribute
instanceLocalVariableTypeTableAttribute
instancejava.lang.IllegalArgumentException
- thrown if, and only if, attributeNameIndex
is less than or equal to 0