@ProblemClassification(value=DEFAULT) @DefaultSeverity(value=ERROR) public abstract class CompilerProblem extends Object implements ICompilerProblem
UNKNOWN
Constructor and Description |
---|
CompilerProblem()
Constructor for a problem with no source-location information.
|
CompilerProblem(ASToken site)
Constructor for a problem associated with an
ASToken . |
CompilerProblem(IDefinition site)
Constructor for a problem associated with an
IDefinition . |
CompilerProblem(ISourceLocation site)
Constructor for a problem associated with an object
implementing
ISourceLocation . |
CompilerProblem(String sourcePath)
Constructor for a problem whose only source-location information
is a source path.
|
CompilerProblem(String sourcePath,
int start,
int end,
int line,
int column)
Constructor.
|
CompilerProblem(String sourcePath,
int start,
int end,
int line,
int column,
boolean normalizeFilePath)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getAbsoluteEnd()
Gets the absolute starting offset.
|
int |
getAbsoluteStart()
Gets the absolute starting offset.
|
int |
getColumn()
Gets the local column number.
|
int |
getEnd()
Gets the local ending offset.
|
int |
getEndColumn()
Gets the local column number at the end.
|
int |
getEndLine()
Gets the local line number at the end.
|
String |
getID()
Returns a unique identifier for this type of problem.
|
int |
getLine()
Gets the local line number.
|
String |
getSourcePath()
Gets the normalized source path.
|
int |
getStart()
Gets the local starting offset.
|
String |
toString()
Returns a String for displaying this compiler problem in a console window.
|
public CompilerProblem(String sourcePath, int start, int end, int line, int column, boolean normalizeFilePath)
sourcePath
- The path of the file in which the problem occurred.start
- The offset within the source buffer at which the problem starts.end
- The offset within the source buffer at which the problem ends.line
- The line number within the source buffer at which the problem starts.column
- The column number within the source buffer at which the problem starts.normalizeFilePath
- true if the path can be normalized. This is needed
by configuration problems that have the "command line" as there source.public CompilerProblem(String sourcePath, int start, int end, int line, int column)
sourcePath
- The normalized path of the file in which the problem occurred.start
- The offset within the source buffer at which the problem starts.end
- The offset within the source buffer at which the problem ends.line
- The line number within the source buffer at which the problem starts.column
- The column number within the source buffer at which the problem starts.public CompilerProblem(String sourcePath)
sourcePath
- The normalized path of the file
in which the problem occurred.public CompilerProblem()
public CompilerProblem(ISourceLocation site)
ISourceLocation
.site
- The ISourceLocation
where the problem occurred.public CompilerProblem(IDefinition site)
IDefinition
.site
- The IDefinition
where the problem occurred.public String getID()
ICompilerProblem
Clients can use this identifier to look up, in a .properties file, a localized template string describing the problem. The template string can have named placeholders such as ${name} to be filled in, based on correspondingly-named fields in the problem instance.
Clients can also use this identifier to decide whether the problem is an error, a warning, or something else; for example, they might keep a list of error ids and a list of warning ids.
The unique identifier happens to be the fully-qualified classname of the problem class.
getID
in interface ICompilerProblem
public String getSourcePath()
ISourceLocation
getSourcePath
in interface ISourceLocation
public int getStart()
ISourceLocation
getStart
in interface ISourceLocation
public int getEnd()
ISourceLocation
getEnd
in interface ISourceLocation
public int getLine()
ISourceLocation
getLine
in interface ISourceLocation
public int getColumn()
ISourceLocation
getColumn
in interface ISourceLocation
public int getEndLine()
ISourceLocation
getEndLine
in interface ISourceLocation
public int getEndColumn()
ISourceLocation
getEndColumn
in interface ISourceLocation
public int getAbsoluteStart()
ISourceLocation
getAbsoluteStart
in interface ISourceLocation
public int getAbsoluteEnd()
ISourceLocation
getAbsoluteEnd
in interface ISourceLocation
public String toString()
Copyright © 2016 The Apache Software Foundation. All rights reserved.