public final class TrailingWhitespaceEditor extends LineEditor
LineEditor
removing trailing whitespace.LineEditor.edit(java.lang.String)
Constructor and Description |
---|
TrailingWhitespaceEditor()
Creates a new
TrailingWhitespaceEditor instance. |
TrailingWhitespaceEditor(LineEditor editor)
Creates a new
TrailingWhitespaceEditor instance taking an editor to chain. |
TrailingWhitespaceEditor(LineEditor editor,
String lineSeparator)
Creates a new
TrailingWhitespaceEditor instance taking an editor to chain and a string to use for
separating lines. |
TrailingWhitespaceEditor(String lineSeparator)
Creates a new
TrailingWhitespaceEditor instance taking a string to use for separating lines. |
Modifier and Type | Method and Description |
---|---|
protected String |
editLine(String line)
Edits a line.
|
edit, getLineNumber, getLineSeparator
public TrailingWhitespaceEditor()
TrailingWhitespaceEditor
instance.public TrailingWhitespaceEditor(String lineSeparator)
TrailingWhitespaceEditor
instance taking a string to use for separating lines.lineSeparator
- String to use for separating lines.public TrailingWhitespaceEditor(LineEditor editor)
TrailingWhitespaceEditor
instance taking an editor to chain.editor
- The editor to chain.public TrailingWhitespaceEditor(LineEditor editor, String lineSeparator)
TrailingWhitespaceEditor
instance taking an editor to chain and a string to use for
separating lines.editor
- The editor to chain.lineSeparator
- String to use for separating lines.protected String editLine(String line)
This method returns line
with any trailing whitespace characters removed.
editLine
in class LineEditor
line
- The line to edit or null
, indicating the end of input.line
with or null
, to replace line
with nothing.Character.isWhitespace(char)
Copyright © 2005–2016 The JOMC Project. All rights reserved.