public class SourceLocation extends java.lang.Object implements ISourceLocation
SourceLocation
,
org.aspectj.compiler.base.parser.SourceInfo
,
org.aspectj.tools.ide.SourceLine
,
org.aspectj.testing.harness.ErrorLine
,
Serialized FormModifier and Type | Field and Description |
---|---|
static ISourceLocation |
UNKNOWN
used when SourceLocation is not available
|
EMPTY, MAX_COLUMN, MAX_LINE, NO_COLUMN, NO_FILE
Constructor and Description |
---|
SourceLocation(java.io.File file,
int line)
Same as SourceLocation(file, line, line, 0), except that column is not rendered during toString()
|
SourceLocation(java.io.File file,
int line,
int endLine)
same as SourceLocation(file, line, endLine, ISourceLocation.NO_COLUMN)
|
SourceLocation(java.io.File file,
int line,
int endLine,
int column) |
SourceLocation(java.io.File file,
int line,
int endLine,
int column,
java.lang.String context) |
SourceLocation(java.io.File file,
int line,
int endLine,
int column,
java.lang.String context,
java.lang.String sourceFileName) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
getColumn() |
java.lang.String |
getContext() |
int |
getEndLine() |
int |
getLine() |
int |
getOffset() |
java.io.File |
getSourceFile() |
java.lang.String |
getSourceFileName()
In the cases where getSourceFile().getName() returns a class file (for example when we have a binary aspect) this should
return the name of the source file (for example BinaryAspect.aj)
|
int |
hashCode() |
void |
setOffset(int i) |
java.lang.String |
toString() |
static void |
validColumn(int column) |
static void |
validLine(int line) |
public static final ISourceLocation UNKNOWN
public SourceLocation(java.io.File file, int line)
public SourceLocation(java.io.File file, int line, int endLine)
public SourceLocation(java.io.File file, int line, int endLine, int column)
file
- File of the source; if null, use ISourceLocation.NO_FILE, not nullline
- int starting line of the location - positive numberendLine
- int ending line of the location - <= starting linecolumn
- int character position of starting location - positive numberpublic SourceLocation(java.io.File file, int line, int endLine, int column, java.lang.String context)
public SourceLocation(java.io.File file, int line, int endLine, int column, java.lang.String context, java.lang.String sourceFileName)
public static final void validLine(int line)
java.lang.IllegalArgumentException
- if the input would not be a valid linepublic static final void validColumn(int column)
java.lang.IllegalArgumentException
- if the input would not be a valid columnpublic java.io.File getSourceFile()
getSourceFile
in interface ISourceLocation
public int getLine()
getLine
in interface ISourceLocation
public int getColumn()
getColumn
in interface ISourceLocation
public int getEndLine()
getEndLine
in interface ISourceLocation
public java.lang.String getContext()
getContext
in interface ISourceLocation
public java.lang.String toString()
toString
in class java.lang.Object
public int getOffset()
getOffset
in interface ISourceLocation
public void setOffset(int i)
public java.lang.String getSourceFileName()
ISourceLocation
getSourceFileName
in interface ISourceLocation
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object