public class JSError extends Object
| Modifier and Type | Field and Description |
|---|---|
String |
description
Description of the error
|
CheckLevel |
level
Deprecated.
Use #getDefaultLevel
|
int |
lineNumber
Line number of the source
|
String |
sourceName
Name of the source
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
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,
String... arguments)
Creates a JSError with no source information
|
static JSError |
make(String sourceName,
int lineno,
int charno,
CheckLevel level,
DiagnosticType type,
String... arguments)
Creates a JSError at a given source location
|
static JSError |
make(String sourceName,
int lineno,
int charno,
DiagnosticType type,
String... arguments)
Creates a JSError at a given source location
|
static JSError |
make(String sourceName,
Node n,
CheckLevel level,
DiagnosticType type,
String... arguments)
Creates a JSError from a file and Node position.
|
static JSError |
make(String sourceName,
Node n,
DiagnosticType type,
String... arguments)
Creates a JSError from a file and Node position.
|
String |
toString() |
public final String description
public final String sourceName
public final int lineNumber
@Deprecated public final CheckLevel level
public static JSError make(DiagnosticType type, String... arguments)
type - The DiagnosticTypearguments - Arguments to be incorporated into the messagepublic static JSError make(String sourceName, int lineno, int charno, DiagnosticType type, 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(String sourceName, int lineno, int charno, CheckLevel level, DiagnosticType type, 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(String sourceName, Node n, DiagnosticType type, String... arguments)
sourceName - The source file namen - Determines the line and char position within the source file nametype - The DiagnosticTypearguments - Arguments to be incorporated into the messagepublic static JSError make(String sourceName, Node n, CheckLevel level, DiagnosticType type, String... arguments)
sourceName - The source file namen - Determines the line and char position within the source file nametype - The DiagnosticTypearguments - Arguments to be incorporated into the messagepublic DiagnosticType getType()
public String format(CheckLevel level, MessageFormatter formatter)
nullpublic int getCharno()
public int getLineNumber()
public int getNodeSourceOffset()
public int getNodeLength()
public CheckLevel getDefaultLevel()