@ParametersAreNonnullByDefault public class SourceLocation extends Object
| Modifier and Type | Field and Description |
|---|---|
static SourceLocation |
UNKNOWN
Deprecated.
There is no reason to use this other than laziness. Soy has complete source
location information.
|
| Constructor and Description |
|---|
SourceLocation(String filePath) |
SourceLocation(String filePath,
int beginLine,
int beginColumn,
int endLine,
int endColumn) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
SourceLocation |
extend(SourceLocation other)
Returns a new SourceLocation that starts where this SourceLocation starts
and ends where
other ends. |
int |
getBeginColumn()
Returns the column number in the source file where this location begins (1-based).
|
int |
getEndColumn()
Returns the column number in the source file where this location ends (1-based).
|
int |
getEndLine()
Returns the line number in the source file where this location ends (1-based).
|
String |
getFileName() |
String |
getFilePath()
Returns a file path or URI useful for error messages.
|
int |
getLineNumber()
Returns the line number in the source file where this location begins (1-based).
|
int |
hashCode() |
boolean |
isKnown()
Deprecated.
For the same reason that
UNKNOWN is. |
String |
toString() |
@Deprecated public static final SourceLocation UNKNOWN
public SourceLocation(String filePath, int beginLine, int beginColumn, int endLine, int endColumn)
filePath - A file path or URI useful for error messages.beginLine - The line number in the source file where this location begins (1-based),
or -1 if associated with the entire file instead of a line.beginColumn - The column number in the source file where this location begins (1-based),
or -1 if associated with the entire file instead of a line.endLine - The line number in the source file where this location ends (1-based),
or -1 if associated with the entire file instead of a line.endColumn - The column number in the source file where this location ends (1-based),
or -1 if associated with the entire file instead of a line.public SourceLocation(String filePath)
@Nonnull public String getFilePath()
public int getLineNumber()
public int getBeginColumn()
public int getEndLine()
public int getEndColumn()
@Deprecated public boolean isKnown()
UNKNOWN is.UNKNOWN.public SourceLocation extend(SourceLocation other)
other ends.