Class BlankLinesWriter.NewLinesHandler

java.lang.Object
au.com.acegi.xmlformat.BlankLinesWriter.NewLinesHandler
Enclosing class:
BlankLinesWriter

private class BlankLinesWriter.NewLinesHandler extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    Marks the end of token streams, allows to emit a last newlines if the last tokens were all newlines.
    private boolean
    processToken(String token, boolean hasMoreTokens)
    Processes the token, counting the newlines and producing at most one in output.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • newLinesCount

      private int newLinesCount
  • Constructor Details

    • NewLinesHandler

      private NewLinesHandler()
  • Method Details

    • processToken

      private boolean processToken(String token, boolean hasMoreTokens) throws IOException
      Processes the token, counting the newlines and producing at most one in output.
      Parameters:
      token - The token to be written
      hasMoreTokens - Does more tokens exist
      Returns:
      True if the token needs to be skipped (it's a newline or a set of newlines)
      Throws:
      IOException - If an I/O error occurs.
    • finished

      private void finished() throws IOException
      Marks the end of token streams, allows to emit a last newlines if the last tokens were all newlines.
      Throws:
      IOException - If an I/O error occurs.