public class CustomErrorListener
extends org.antlr.v4.runtime.BaseErrorListener
Modifier and Type | Class and Description |
---|---|
class |
CustomErrorListener.ParseIssue
A parse issue (such as an parse error or a parse warning).
|
static class |
CustomErrorListener.ParseIssueType
Parse issues can be syntax errors, validation errors, and validation
warnings.
|
Constructor and Description |
---|
CustomErrorListener() |
Modifier and Type | Method and Description |
---|---|
static String |
generateParseIssuesMessage(String scriptString,
List<CustomErrorListener.ParseIssue> parseIssues)
Generate a message displaying information about the parse issues that
occurred.
|
String |
getCurrentFileName() |
List<CustomErrorListener.ParseIssue> |
getParseIssues()
Obtain the list of parse issues.
|
boolean |
isAtLeastOneError() |
boolean |
isAtLeastOneWarning() |
void |
setAtLeastOneError(boolean atleastOneError) |
void |
setAtLeastOneWarning(boolean atLeastOneWarning) |
void |
setCurrentFileName(String currentFilePath) |
void |
setParseIssues(List<CustomErrorListener.ParseIssue> parseIssues)
Set the list of parse issues.
|
void |
syntaxError(org.antlr.v4.runtime.Recognizer<?,?> recognizer,
Object offendingSymbol,
int line,
int charPositionInLine,
String msg,
org.antlr.v4.runtime.RecognitionException e)
Syntax error occurred.
|
void |
unsetCurrentFileName() |
void |
validationError(int line,
int charPositionInLine,
String msg)
Validation error occurred.
|
void |
validationError(ParseInfo parseInfo,
String msg) |
void |
validationWarning(int line,
int charPositionInLine,
String msg)
Validation warning occurred.
|
public void setCurrentFileName(String currentFilePath)
public String getCurrentFileName()
public void unsetCurrentFileName()
public void validationError(int line, int charPositionInLine, String msg)
line
- Line number where error was detectedcharPositionInLine
- Character position where error was detectedmsg
- Message describing the nature of the validation errorpublic void validationWarning(int line, int charPositionInLine, String msg)
line
- Line number where warning was detectedcharPositionInLine
- Character position where warning was detectedmsg
- Message describing the nature of the validation warningpublic void syntaxError(org.antlr.v4.runtime.Recognizer<?,?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, org.antlr.v4.runtime.RecognitionException e)
syntaxError
in interface org.antlr.v4.runtime.ANTLRErrorListener
syntaxError
in class org.antlr.v4.runtime.BaseErrorListener
public boolean isAtLeastOneError()
public void setAtLeastOneError(boolean atleastOneError)
public boolean isAtLeastOneWarning()
public void setAtLeastOneWarning(boolean atLeastOneWarning)
public List<CustomErrorListener.ParseIssue> getParseIssues()
public void setParseIssues(List<CustomErrorListener.ParseIssue> parseIssues)
parseIssues
- The list of parse issues.public static String generateParseIssuesMessage(String scriptString, List<CustomErrorListener.ParseIssue> parseIssues)
scriptString
- The DML or PYDML script string.parseIssues
- The list of parse issues.Copyright © 2022 The Apache Software Foundation. All rights reserved.