MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mysql.clusterj.jdbc.antlr.ErrorListener Interface Reference
Inheritance diagram for com.mysql.clusterj.jdbc.antlr.ErrorListener:

Public Member Functions

void displayRecognitionError (String[] tokenNames, RecognitionException e)
void reportError (RecognitionException e)
String getErrorHeader (RecognitionException e)
String getErrorMessage (RecognitionException e, String[] tokenNames)
void emitErrorMessage (String msg)
boolean hasErrors ()
List< RecognitionException > getErrors ()

Detailed Description

Generic ErrorListener for RecognitionExceptions. Enables client code to flexibly override error handling/presentation. Author: kroepke

Definition at line 30 of file ErrorListener.java.

Member Function Documentation

void com.mysql.clusterj.jdbc.antlr.ErrorListener.displayRecognitionError ( String[]  tokenNames,
RecognitionException  e 
)

Called by reportError to display a recognition error. Normally it is sufficient to implement this method.

Parameters
tokenNames
e

Implemented in com.mysql.clusterj.jdbc.antlr.QueuingErrorListener.

Here is the caller graph for this function:

void com.mysql.clusterj.jdbc.antlr.ErrorListener.emitErrorMessage ( String  msg)

Redirects an error message to the appropriate place, relying on the other methods to actually produce a message

Parameters
msgPreformatted error message

Implemented in com.mysql.clusterj.jdbc.antlr.QueuingErrorListener.

String com.mysql.clusterj.jdbc.antlr.ErrorListener.getErrorHeader ( RecognitionException  e)

Generates a header line for error messages, normally containing source file and the position in the file where the error occured.

Parameters
e
Returns
String to print as a location information for the error
String com.mysql.clusterj.jdbc.antlr.ErrorListener.getErrorMessage ( RecognitionException  e,
String[]  tokenNames 
)

Generates the message string for the actual error occured, must distinguish between the different RecognitionException subclasses.

Parameters
e
tokenNames
Returns
String to print as an explanation of the error
List<RecognitionException> com.mysql.clusterj.jdbc.antlr.ErrorListener.getErrors ( )

Retrieve the list of errors occurred.

Returns
Might be null for ErrorListeners that don't queue up errors.

Implemented in com.mysql.clusterj.jdbc.antlr.QueuingErrorListener, and com.mysql.clusterj.jdbc.antlr.BaseErrorListener.

boolean com.mysql.clusterj.jdbc.antlr.ErrorListener.hasErrors ( )

Check whether errors have occurred during recognition.

Returns
true if errors have occurred

Implemented in com.mysql.clusterj.jdbc.antlr.BaseErrorListener, and com.mysql.clusterj.jdbc.antlr.QueuingErrorListener.

void com.mysql.clusterj.jdbc.antlr.ErrorListener.reportError ( RecognitionException  e)

The main entry point for reporting recognition errors. Override only if you want to show "spurious" errors during recovery, too.

See Also
org.antlr.runtime.BaseRecognizer.reportError
Parameters
eA runtime exception containing information about the error.

The documentation for this interface was generated from the following file: