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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ISourceLocationused when SourceLocation is not availableFields inherited from interface org.aspectj.bridge.ISourceLocation
EMPTY, MAX_COLUMN, MAX_LINE, NO_COLUMN, NO_FILE -
Constructor Summary
ConstructorsConstructorDescriptionSourceLocation(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 TypeMethodDescriptionbooleanintintintgetLine()intIn 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)inthashCode()voidsetOffset(int i) toString()static final voidvalidColumn(int column) static final voidvalidLine(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:
getSourceFilein interfaceISourceLocation- Returns:
- File source or NO_FILE if the implementation requires a non-null result or null otherwise
-
getLine
public int getLine()- Specified by:
getLinein interfaceISourceLocation- Returns:
- 0..MAX_LINE
-
getColumn
public int getColumn()- Specified by:
getColumnin interfaceISourceLocation- Returns:
- int actual column or 0 if not available per constructor treatment of ISourceLocation.NO_COLUMN
-
getEndLine
public int getEndLine()- Specified by:
getEndLinein interfaceISourceLocation- Returns:
- getLine()..MAX_LINE
-
getContext
- Specified by:
getContextin interfaceISourceLocation- Returns:
- null String or application-specific context
-
toString
-
getOffset
public int getOffset()- Specified by:
getOffsetin interfaceISourceLocation- Returns:
- offset into file
-
setOffset
public void setOffset(int i) -
getSourceFileName
Description copied from interface:ISourceLocationIn 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:
getSourceFileNamein interfaceISourceLocation- Returns:
- the name of the source file
-
equals
-
hashCode
public int hashCode()
-