Class StreamingParser

  • All Implemented Interfaces:
    Closeable, Flushable, Appendable, AutoCloseable

    public abstract class StreamingParser
    extends Writer
    Baseclass for LoggingFilterWriter. Provides functionality to filter a writer. It looks for a begin and end delimiter and calls the handle method when a pair is found. Subclasses must implement this handle method.
    • Constructor Detail

      • StreamingParser

        public StreamingParser​(String startDelimiter,
                               String endDelimiter)
        Constructs a StreamingParser.
        Parameters:
        startDelimiter - The start string
        endDelimiter - The end string
    • Method Detail

      • characters

        protected abstract void characters​(char[] values,
                                           int from,
                                           int to)
                                    throws IOException
        Throws:
        IOException
      • write

        public void write​(int c)
                   throws IOException
        Write a single character.
        Overrides:
        write in class Writer
        Parameters:
        c - int specifying a character to be written.
        Throws:
        IOException - If an I/O error occurs
      • write

        public void write​(char[] str,
                          int off,
                          int len)
                   throws IOException
        Write a portion of an array of characters.
        Specified by:
        write in class Writer
        Parameters:
        str - Array of characters
        off - Offset from which to start writing characters
        len - Number of characters to write
        Throws:
        IOException - If an I/O error occurs
      • write

        public void write​(String str)
                   throws IOException
        Write a string.
        Overrides:
        write in class Writer
        Parameters:
        str - String to be written
        Throws:
        IOException - If an I/O error occurs
      • main

        public static void main​(String[] args)