Package org.aspectj.bridge
Class SourceLocation
java.lang.Object
org.aspectj.bridge.SourceLocation
- All Implemented Interfaces:
Serializable
,ISourceLocation
Immutable source location. This guarantees that the source file is not null and that the numeric values are positive and line ≤
endLine.
- See Also:
SourceLocation
, Serialized Form
-
Field Summary
Modifier and TypeFieldDescriptionstatic ISourceLocation
used when SourceLocation is not availableFields inherited from interface org.aspectj.bridge.ISourceLocation
EMPTY, MAX_COLUMN, MAX_LINE, NO_COLUMN, NO_FILE
-
Constructor Summary
ConstructorDescriptionSourceLocation(File file, int line)
Same as SourceLocation(file, line, line, 0), except that column is not rendered during toString()SourceLocation(File file, int line, int endLine)
same as SourceLocation(file, line, endLine, ISourceLocation.NO_COLUMN)SourceLocation(File file, int line, int endLine, int column)
SourceLocation(File file, int line, int endLine, int column, String context)
SourceLocation(File file, int line, int endLine, int column, String context, String sourceFileName)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
int
int
getLine()
int
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)
toString()
static void
validColumn(int column)
static void
validLine(int line)
-
Field Details
-
UNKNOWN
used when SourceLocation is not available
-
-
Constructor Details
-
SourceLocation
Same as SourceLocation(file, line, line, 0), except that column is not rendered during toString() -
SourceLocation
same as SourceLocation(file, line, endLine, ISourceLocation.NO_COLUMN) -
SourceLocation
- Parameters:
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 number
-
SourceLocation
-
SourceLocation
-
-
Method Details
-
validLine
public static final void validLine(int line)- Throws:
IllegalArgumentException
- if the input would not be a valid line
-
validColumn
public static final void validColumn(int column)- Throws:
IllegalArgumentException
- if the input would not be a valid column
-
getSourceFile
- Specified by:
getSourceFile
in interfaceISourceLocation
- Returns:
- File source or NO_FILE if the implementation requires a non-null result or null otherwise
-
getLine
public int getLine()- Specified by:
getLine
in interfaceISourceLocation
- Returns:
- 0..MAX_LINE
-
getColumn
public int getColumn()- Specified by:
getColumn
in interfaceISourceLocation
- Returns:
- int actual column or 0 if not available per constructor treatment of ISourceLocation.NO_COLUMN
-
getEndLine
public int getEndLine()- Specified by:
getEndLine
in interfaceISourceLocation
- Returns:
- getLine()..MAX_LINE
-
getContext
- Specified by:
getContext
in interfaceISourceLocation
- Returns:
- null String or application-specific context
-
toString
-
getOffset
public int getOffset()- Specified by:
getOffset
in interfaceISourceLocation
- Returns:
- offset into file
-
setOffset
public void setOffset(int i) -
getSourceFileName
Description copied from interface:ISourceLocation
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)- Specified by:
getSourceFileName
in interfaceISourceLocation
- Returns:
- the name of the source file
-
equals
-
hashCode
public int hashCode()
-