public class CodeLocation extends Location
Clazz
and Member
where it is contained, the offset therein and the corresponding line number in the source file
(Location.UNKNOWN_LINE
if it is unknown). Consider the following pseudo-bytecode example
which contains code location comments:
public class Test
{
// class "Test", member "field", line 3, offset 0
public String field;
public String toString()
{
// class "Test", member "toString", line 6, offset 0
aload_0
// class "Test", member "toString", line 6, offset 1
getfield #1 <Test.field : Ljava/lang/String;>
// class "Test", member "toString", line 6, offset 4
areturn
}
}
getfield
instruction
inside toString()
has the offset 1.
Test#field
. A field location has a line number (3 in
this example) but no offset, as this concept is only applicable to methods.
Modifier and Type | Field and Description |
---|---|
Clazz |
clazz |
Member |
member |
int |
offset |
Signature |
signature |
line, UNKNOWN_LINE
Constructor and Description |
---|
CodeLocation(Clazz clazz,
Member member,
int offset)
Create a code location with an unknown (
Location.UNKNOWN_LINE ) line number. |
CodeLocation(Clazz clazz,
Member member,
int offset,
int line) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Location o) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getExternalClassName() |
java.lang.String |
getMemberName() |
java.lang.String |
getName()
Returns the name of the location, e.g., the signature of a CodeLocation, or the filename of a
FileLocation
|
int |
hashCode() |
java.lang.String |
toString() |
public final Clazz clazz
public final Member member
public final int offset
public final Signature signature
public CodeLocation(Clazz clazz, Member member, int offset)
Location.UNKNOWN_LINE
) line number.public java.lang.String getExternalClassName()
public java.lang.String getMemberName()
public java.lang.String getName()
Location
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(Location o)