ErrorCollector (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.cql3

## Class ErrorCollector

- java.lang.Object
- - org.apache.cassandra.cql3.ErrorCollector

- All Implemented Interfaces:
    ErrorListener

      public final class ErrorCollector
      extends java.lang.Object
      implements ErrorListener

  `ErrorListener` that collect and enhance the errors send by the CQL lexer and parser.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ErrorCollector(java.lang.String query)` Creates a new `ErrorCollector` instance to collect the syntax errors associated to the specified CQL query.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `syntaxError(org.antlr.runtime.BaseRecognizer recognizer, java.lang.String errorMsg)` Invoked when a syntax error with a specified message occurs.
    `void` | `syntaxError(org.antlr.runtime.BaseRecognizer recognizer, java.lang.String[] tokenNames, org.antlr.runtime.RecognitionException e)` Invoked when a syntax error occurs.
    `void` | `throwFirstSyntaxError()` Throws the first syntax error found by the lexer or the parser if it exists.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ErrorCollector

          public ErrorCollector(java.lang.String query)

      Creates a new `ErrorCollector` instance to collect the syntax errors associated to the specified CQL query.
      Parameters:
        `query` - the CQL query that will be parsed

  - ### Method Detail

    - #### syntaxError

          public void syntaxError(org.antlr.runtime.BaseRecognizer recognizer,
                                  java.lang.String[] tokenNames,
                                  org.antlr.runtime.RecognitionException e)

      Invoked when a syntax error occurs.
      Specified by:
        `syntaxError` in interface `ErrorListener`
      Parameters:
        `recognizer` - the parser or lexer that emitted the error
        `tokenNames` - the token names
        `e` - the exception

    - #### syntaxError

          public void syntaxError(org.antlr.runtime.BaseRecognizer recognizer,
                                  java.lang.String errorMsg)

      Invoked when a syntax error with a specified message occurs.
      Specified by:
        `syntaxError` in interface `ErrorListener`
      Parameters:
        `recognizer` - the parser or lexer that emitted the error
        `errorMsg` - the error message

    - #### throwFirstSyntaxError

          public void throwFirstSyntaxError()
                                     throws SyntaxException

      Throws the first syntax error found by the lexer or the parser if it exists.
      Throws:
        `SyntaxException` - the syntax error.

Copyright © 2018 The Apache Software Foundation