org.aspectj.bridge
Interface ISourceLocation

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
SourceLocation

public interface ISourceLocation
extends java.io.Serializable

Represent source location as a starting line/column and ending line in a source file. Implementations should be immutable. XXX why?

See Also:
SourceLocation, org.aspectj.compiler.base.parser.SourceInfo, org.aspectj.tools.ide.SourceLine, org.aspectj.testing.harness.ErrorLine

Field Summary
static ISourceLocation EMPTY
          non-null but empty constant source location
static int MAX_COLUMN
           
static int MAX_LINE
           
static int NO_COLUMN
          signal that column is not known
static java.io.File NO_FILE
          non-null but empty (nonexisting) File constant
 
Method Summary
 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)
 

Field Detail

MAX_LINE

static final int MAX_LINE
See Also:
Constant Field Values

MAX_COLUMN

static final int MAX_COLUMN
See Also:
Constant Field Values

NO_FILE

static final java.io.File NO_FILE
non-null but empty (nonexisting) File constant


NO_COLUMN

static final int NO_COLUMN
signal that column is not known

See Also:
Constant Field Values

EMPTY

static final ISourceLocation EMPTY
non-null but empty constant source location

Method Detail

getSourceFile

java.io.File getSourceFile()
Returns:
File source or NO_FILE if the implementation requires a non-null result or null otherwise

getLine

int getLine()
Returns:
0..MAX_LINE

getColumn

int getColumn()
Returns:
int 0..MAX_COLUMN actual column or 0 if column input was ISourceLocation.NO_COLUMN

getOffset

int getOffset()
Returns:
offset into file

getEndLine

int getEndLine()
Returns:
getLine()..MAX_LINE

getContext

java.lang.String getContext()
Returns:
String application-specific context for source

getSourceFileName

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)

Returns:
the name of the source file