01: /*
02:
03: This software is OSI Certified Open Source Software.
04: OSI Certified is a certification mark of the Open Source Initiative.
05:
06: The license (Mozilla version 1.0) can be read at the MMBase site.
07: See http://www.MMBase.org/license
08:
09: */
10: package org.mmbase.util.transformers;
11:
12: import java.io.Reader;
13: import java.io.Writer;
14:
15: /**
16: * This tranformer is the equivalent of piping to /dev/null
17: *
18: * @author Michiel Meeuwissen
19: * @since MMBase-1.7
20: * @version $Id: Swallower.java,v 1.1 2003/05/11 10:12:56 michiel Exp $
21: */
22:
23: public class Swallower extends ReaderTransformer implements
24: CharTransformer {
25:
26: // implementation, javadoc inherited
27: public Writer transform(Reader r, Writer w) {
28: return w;
29: }
30:
31: // implementation, javadoc inherited
32: public Writer transformBack(Reader r, Writer w) {
33: throw new UnsupportedOperationException(
34: "This is utterly impossible :-)");
35: }
36:
37: // overridden for performance.
38: public String transform(String s) {
39: return "";
40: }
41:
42: public String toString() {
43: return "SWALLOW";
44: }
45:
46: }
|