Package au.com.acegi.xmlformat
Class BlankLinesWriter.NewLinesHandler
java.lang.Object
au.com.acegi.xmlformat.BlankLinesWriter.NewLinesHandler
- Enclosing class:
BlankLinesWriter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidfinished()Marks the end of token streams, allows to emit a last newlines if the last tokens were all newlines.private booleanprocessToken(String token, boolean hasMoreTokens) Processes the token, counting the newlines and producing at most one in output.
-
Field Details
-
newLinesCount
private int newLinesCount
-
-
Constructor Details
-
NewLinesHandler
private NewLinesHandler()
-
-
Method Details
-
processToken
Processes 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:
IOException- If an I/O error occurs.
-
finished
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.
-