Package au.com.acegi.xmlformat
Class BlankLinesWriter.NewLinesHandler
- java.lang.Object
-
- au.com.acegi.xmlformat.BlankLinesWriter.NewLinesHandler
-
- Enclosing class:
- BlankLinesWriter
private class BlankLinesWriter.NewLinesHandler extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private intnewLinesCount
-
Constructor Summary
Constructors Modifier Constructor Description privateNewLinesHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidfinished()Marks the end of token streams, allows to emit a last newlines if the last tokens were all newlines.private booleanprocessToken(java.lang.String token, boolean hasMoreTokens)Processes the token, counting the newlines and producing at most one in output.
-
-
-
Method Detail
-
processToken
private boolean processToken(java.lang.String token, boolean hasMoreTokens) throws java.io.IOExceptionProcesses the token, counting the newlines and producing at most one in output.- Parameters:
token- The token to be writtenhasMoreTokens- Does more tokens exist- Returns:
- True if the token needs to be skipped (it's a newline or a set of newlines)
- Throws:
java.io.IOException- If an I/O error occurs.
-
finished
private void finished() throws java.io.IOExceptionMarks the end of token streams, allows to emit a last newlines if the last tokens were all newlines.- Throws:
java.io.IOException- If an I/O error occurs.
-
-