org.jomc.util
Class TrailingWhitespaceEditor

Package class diagram package TrailingWhitespaceEditor
java.lang.Object
  extended by org.jomc.util.LineEditor
      extended by org.jomc.util.TrailingWhitespaceEditor

public final class TrailingWhitespaceEditor
extends LineEditor

LineEditor removing trailing whitespace.

Version:
$JOMC: TrailingWhitespaceEditor.java 3838 2011-10-08 20:15:41Z schulte2005 $
Author:
Christian Schulte
See Also:
LineEditor.edit(java.lang.String)

Constructor Summary
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.
 
Method Summary
protected  String editLine(String line)
          Edits a line.
 
Methods inherited from class org.jomc.util.LineEditor
edit, getLineNumber, getLineSeparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrailingWhitespaceEditor

public TrailingWhitespaceEditor()
Creates a new TrailingWhitespaceEditor instance.


TrailingWhitespaceEditor

public TrailingWhitespaceEditor(String lineSeparator)
Creates a new TrailingWhitespaceEditor instance taking a string to use for separating lines.

Parameters:
lineSeparator - String to use for separating lines.

TrailingWhitespaceEditor

public TrailingWhitespaceEditor(LineEditor editor)
Creates a new TrailingWhitespaceEditor instance taking an editor to chain.

Parameters:
editor - The editor to chain.

TrailingWhitespaceEditor

public TrailingWhitespaceEditor(LineEditor editor,
                                String lineSeparator)
Creates a new TrailingWhitespaceEditor instance taking an editor to chain and a string to use for separating lines.

Parameters:
editor - The editor to chain.
lineSeparator - String to use for separating lines.
Method Detail

editLine

protected String editLine(String line)
Edits a line.

This method returns line with any trailing whitespace characters removed.

Overrides:
editLine in class LineEditor
Parameters:
line - The line to edit or null, indicating the end of input.
Returns:
The string to replace line with or null, to replace line with nothing.
See Also:
Character.isWhitespace(char)


Copyright © 2005-2012 The JOMC Project. All Rights Reserved.Get JOMC at SourceForge.net. Fast, secure and Free Open Source software downloads
Please note that this documentation is maintained by non-native english speaking authors. As such, you may encounter phrases or wordings which seem imprecise or may even have a totally different meaning to native english speaking readers than what the individual author was trying to express. If you are a native english speaking reader and find any such phrases or wordings we kindly ask you to send an email to the corresponding author and help us improve this documentation in order to avoid misunderstandings. You will find the authors' email addresses at the top of each class. Please accept our apologies for any inconvenience caused.