public abstract class JSError
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Method and Description |
---|---|
java.lang.String |
format(CheckLevel level,
MessageFormatter formatter)
Format a message at the given level.
|
abstract int |
getCharno()
Zero-indexed character number of the error location.
|
abstract CheckLevel |
getDefaultLevel()
The default level, before any of the
WarningsGuard s are applied. |
abstract java.lang.String |
getDescription()
Description of the error.
|
abstract int |
getLineno()
One-indexed line number of the error location.
|
int |
getLineNumber()
Alias for
getLineno() . |
abstract Node |
getNode()
Node where the warning occurred.
|
int |
getNodeLength() |
int |
getNodeSourceOffset() |
abstract java.lang.String |
getSourceName()
Name of the source
|
abstract DiagnosticType |
getType()
A type of the error.
|
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)
Creates a JSError from a file and Node position.
|
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() |
public abstract DiagnosticType getType()
public abstract java.lang.String getDescription()
@Nullable public abstract java.lang.String getSourceName()
public abstract int getLineno()
public abstract int getCharno()
@Nullable public abstract Node getNode()
public abstract CheckLevel getDefaultLevel()
WarningsGuard
s are applied.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 final java.lang.String toString()
toString
in class java.lang.Object
public final java.lang.String format(CheckLevel level, MessageFormatter formatter)
null
public final int getNodeSourceOffset()
public final int getNodeLength()
public final int getLineNumber()
getLineno()
.Copyright © 2009-2019 Google. All Rights Reserved.