public final class JSError
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
charno |
private CheckLevel |
defaultLevel |
java.lang.String |
description
Description of the error
|
CheckLevel |
level
Deprecated.
Use #getDefaultLevel
|
int |
lineNumber
Line number of the source
|
Node |
node
Node where the warning occurred.
|
java.lang.String |
sourceName
Name of the source
|
private DiagnosticType |
type
A type of the error
|
Modifier | Constructor and Description |
---|---|
private |
JSError(java.lang.String sourceName,
Node node,
DiagnosticType type,
java.lang.String... arguments)
Creates a JSError for a source file location.
|
private |
JSError(java.lang.String sourceName,
Node node,
int lineno,
int charno,
DiagnosticType type,
CheckLevel level,
java.lang.String... arguments)
Creates a JSError at a CheckLevel for a source file location.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
format(CheckLevel level,
MessageFormatter formatter)
Format a message at the given level.
|
int |
getCharno()
Get the character number.
|
CheckLevel |
getDefaultLevel()
The default level, before any of the WarningsGuards are applied.
|
int |
getLineNumber()
Get the line number.
|
int |
getNodeLength() |
int |
getNodeSourceOffset() |
DiagnosticType |
getType() |
int |
hashCode() |
static JSError |
make(DiagnosticType type,
java.lang.String... arguments)
Creates a JSError with no source information
|
static JSError |
make(Node n,
CheckLevel level,
DiagnosticType type,
java.lang.String... arguments) |
static JSError |
make(Node n,
DiagnosticType type,
java.lang.String... arguments)
Creates a JSError from a file and Node position.
|
static JSError |
make(java.lang.String sourceName,
int lineno,
int charno,
CheckLevel level,
DiagnosticType type,
java.lang.String... arguments)
Creates a JSError at a given source location
|
static JSError |
make(java.lang.String sourceName,
int lineno,
int charno,
DiagnosticType type,
java.lang.String... arguments)
Creates a JSError at a given source location
|
java.lang.String |
toString() |
private final DiagnosticType type
public final java.lang.String description
public final java.lang.String sourceName
public final Node node
public final int lineNumber
@Deprecated public final CheckLevel level
private final CheckLevel defaultLevel
private final int charno
private JSError(java.lang.String sourceName, @Nullable Node node, int lineno, int charno, DiagnosticType type, CheckLevel level, java.lang.String... arguments)
private JSError(java.lang.String sourceName, @Nullable Node node, DiagnosticType type, java.lang.String... arguments)
public static JSError make(DiagnosticType type, java.lang.String... arguments)
type
- The DiagnosticTypearguments
- Arguments to be incorporated into the messagepublic static JSError make(java.lang.String sourceName, int lineno, int charno, DiagnosticType type, java.lang.String... arguments)
sourceName
- The source file namelineno
- Line number with source file, or -1 if unknowncharno
- Column number within line, or -1 for whole line.type
- The DiagnosticTypearguments
- Arguments to be incorporated into the messagepublic static JSError make(java.lang.String sourceName, int lineno, int charno, CheckLevel level, DiagnosticType type, java.lang.String... arguments)
sourceName
- The source file namelineno
- Line number with source file, or -1 if unknowncharno
- Column number within line, or -1 for whole line.type
- The DiagnosticTypearguments
- Arguments to be incorporated into the messagepublic static JSError make(Node n, DiagnosticType type, java.lang.String... arguments)
n
- Determines the line and char position and source file nametype
- The DiagnosticTypearguments
- Arguments to be incorporated into the messagepublic static JSError make(Node n, CheckLevel level, DiagnosticType type, java.lang.String... arguments)
public DiagnosticType getType()
public java.lang.String format(CheckLevel level, MessageFormatter formatter)
null
public java.lang.String toString()
toString
in class java.lang.Object
public int getCharno()
public int getLineNumber()
public int getNodeSourceOffset()
public int getNodeLength()
public CheckLevel getDefaultLevel()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object