org.mmbase.util.transformers
Class SpaceReducer

java.lang.Object
  extended byorg.mmbase.util.transformers.ReaderTransformer
      extended byorg.mmbase.util.transformers.SpaceReducer
All Implemented Interfaces:
CharTransformer, Transformer

public class SpaceReducer
extends ReaderTransformer
implements CharTransformer

Replace 1 or more spaces by 1 space, and 1 or more newlines by 1 newline. Any other combination of newlines and spaces is replaced by one newline. Except if they are in between "

" and
 "
". (Note: perhaps this last behaviour should be made configurable.

Since:
MMBase-1.7
Author:
Michiel Meeuwissen
To Do:
'pre' stuff not yet implemented.

Constructor Summary
SpaceReducer()
           
 
Method Summary
 java.lang.String toString()
           
 java.io.Writer transform(java.io.Reader r, java.io.Writer w)
           
 
Methods inherited from class org.mmbase.util.transformers.ReaderTransformer
transform, transform, transformBack, transformBack, transformBack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.util.transformers.CharTransformer
transform, transform, transformBack, transformBack, transformBack
 

Constructor Detail

SpaceReducer

public SpaceReducer()
Method Detail

transform

public java.io.Writer transform(java.io.Reader r,
                                java.io.Writer w)
Specified by:
transform in interface CharTransformer
Specified by:
transform in class ReaderTransformer

toString

public java.lang.String toString()
Specified by:
toString in interface Transformer


MMBase build 1.7.1.20041002