Interface TokenErrorHandler<E extends Exception>

All Known Subinterfaces:
TokenHandler, TokenHandler2, TokenHandler3<E>
All Known Implementing Classes:
CommentRemovalHandler

public interface TokenErrorHandler<E extends Exception>
Handle errors generated by the TokenProducer3 and by the other token handlers.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    error(int index, byte errCode, CharSequence context)
    An error was found while parsing.
  • Method Details

    • error

      void error(int index, byte errCode, CharSequence context) throws E
      An error was found while parsing.

      Something was found that broke the assumptions made by the parser, like an escape character at the end of the stream or an unmatched quote.

      Parameters:
      index - the index at which the error was found.
      errCode - the error code.
      context - a context sequence. If a string was parsed, it will contain up to 16 characters before and after the error.
      Throws:
      E - in case that the error handler decides to throw an exception.