Comparable<LocalVariable>
, Mirror
public interface LocalVariable extends Mirror, Comparable<LocalVariable>
Method
has its own LocalVariable object. Variables of the same name declared in different scopes have different LocalVariable objects. LocalVariables can be used alone to retrieve static information about their declaration, or can be used in conjunction with a StackFrame
to set and get values.Modifier and Type | Method | Description |
---|---|---|
boolean |
equals |
Compares the specified Object with this LocalVariable for equality. |
String |
genericSignature() |
Gets the generic signature for this variable if there is one. |
int |
hashCode() |
Returns the hash code value for this LocalVariable. |
boolean |
isArgument() |
Determines if this variable is an argument to its method. |
boolean |
isVisible |
Determines whether this variable can be accessed from the given StackFrame . |
String |
name() |
Gets the name of the local variable. |
String |
signature() |
Gets the type signature of the local variable. |
Type |
type() |
Returns the type of this variable. |
String |
typeName() |
Returns a text representation of the type of this variable. |
compareTo
toString, virtualMachine
String name()
String typeName()
This type name is always available even if the type has not yet been created or loaded.
Type type() throws ClassNotLoadedException
Note: if the type of this variable is a reference type (class, interface, or array) and it has not been created or loaded by the class loader of the enclosing class, then ClassNotLoadedException will be thrown. Also, a reference type may have been loaded but not yet prepared, in which case the type will be returned but attempts to perform some operations on the returned type (e.g. fields()
) will throw a ClassNotPreparedException
. Use ReferenceType.isPrepared()
to determine if a reference type is prepared.
Type
of this local variable.ClassNotLoadedException
- if the type has not yet been loaded through the appropriate class loader.String signature()
String genericSignature()
null
if there is no generic signature.boolean isVisible(StackFrame frame)
StackFrame
. See StackFrame.visibleVariables()
for a complete description variable visibility in this interface.frame
- the StackFrame querying visibilitytrue
if this variable is visible; false
otherwise.IllegalArgumentException
- if the stack frame's method does not match this variable's method.boolean isArgument()
true
if this variable is an argument; false
otherwise.boolean equals(Object obj)
equals
in class Object
obj
- the reference object with which to compare.Method.equals(java.lang.Object)
), and if both LocalVariables mirror the same declaration within that methodint hashCode()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/jdk.jdi/com/sun/jdi/LocalVariable.html