public class ParseError extends Object
Used by ParseException
to collect as many errors as possible before failing (throwing).
Modifier and Type | Class and Description |
---|---|
static class |
ParseError.Severity
Specifies whether an error (unrecoverable problem) or a warning occurred.
|
Modifier | Constructor and Description |
---|---|
protected |
ParseError(Position pos,
String message,
ParseError.Severity severity) |
Modifier and Type | Method and Description |
---|---|
static ParseError |
error(Position pos,
String msg)
Creates a new error for the given position with the given message.
|
String |
getMessage()
Provides the message explaining the error or warning.
|
Position |
getPosition()
Provides the position where the error or warning occurred.
|
ParseError.Severity |
getSeverity()
Returns the severity, which indicates if this is an error or a warning.
|
String |
toString() |
static ParseError |
warning(Position pos,
String msg)
Creates a new warning for the given position with the given message.
|
protected ParseError(Position pos, String message, ParseError.Severity severity)
public static ParseError warning(Position pos, String msg)
If no position is available Position.UNKNOWN
can be used
pos
- the position where the warning occurredmsg
- the message explaining the warningpublic static ParseError error(Position pos, String msg)
If no position is available Position.UNKNOWN
can be used
pos
- the position where the error occurredmsg
- the message explaining the errorpublic Position getPosition()
public String getMessage()
public ParseError.Severity getSeverity()
Copyright © 2020. All rights reserved.