public class NoSourcePosition extends java.lang.Object implements SourcePosition, java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
NoSourcePosition.NullCompilationUnit |
NOPOSITION
Constructor and Description |
---|
NoSourcePosition() |
Modifier and Type | Method and Description |
---|---|
int |
getColumn()
Gets the column in the source file (1 indexed).
|
CompilationUnit |
getCompilationUnit()
Gets the compilation unit for this position.
|
int |
getEndColumn()
Gets the end column in the source file (1 indexed).
|
int |
getEndLine()
Gets the end line in the source file (1 indexed).
|
java.io.File |
getFile()
Gets the file for this position.
|
int |
getLine()
Gets the line in the source file (1 indexed).
|
int |
getSourceEnd()
Gets the index at which the position ends in the source file.
|
int |
getSourceStart()
Gets the index at which the position starts in the source file.
|
boolean |
isValidPosition() |
java.lang.String |
toString()
Returns a string representation of this position in the form
"sourcefile:line", or "sourcefile" if no line number is available.
|
public java.io.File getFile()
SourcePosition
getFile
in interface SourcePosition
public CompilationUnit getCompilationUnit()
SourcePosition
getCompilationUnit
in interface SourcePosition
public boolean isValidPosition()
isValidPosition
in interface SourcePosition
public int getLine()
SourcePosition
SourcePosition.getSourceStart()
}.
For CtNamedElement the line is where the name is declared.getLine
in interface SourcePosition
public int getEndLine()
SourcePosition
SourcePosition.getSourceEnd()
}.getEndLine
in interface SourcePosition
public int getColumn()
SourcePosition
Environment.getTabulationSize()
and
CtCompilationUnit.getOriginalSourceCode()
. Prefer SourcePosition.getSourceStart()
.getColumn
in interface SourcePosition
public int getEndColumn()
SourcePosition
Environment.getTabulationSize()
and
CtCompilationUnit.getOriginalSourceCode()
. Prefer SourcePosition.getSourceEnd()
.getEndColumn
in interface SourcePosition
public int getSourceEnd()
SourcePosition
getSourceEnd
in interface SourcePosition
public int getSourceStart()
SourcePosition
getSourceStart
in interface SourcePosition
public java.lang.String toString()
SourcePosition
toString
in interface SourcePosition
toString
in class java.lang.Object
Copyright © 2007–2021 Inria. All rights reserved.