001: /*
002: * Copyright (c) 2001-2007, Jean Tessier
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions
007: * are met:
008: *
009: * * Redistributions of source code must retain the above copyright
010: * notice, this list of conditions and the following disclaimer.
011: *
012: * * Redistributions in binary form must reproduce the above copyright
013: * notice, this list of conditions and the following disclaimer in the
014: * documentation and/or other materials provided with the distribution.
015: *
016: * * Neither the name of Jean Tessier nor the names of his contributors
017: * may be used to endorse or promote products derived from this software
018: * without specific prior written permission.
019: *
020: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
021: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
022: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
023: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
024: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
025: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
026: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
027: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
028: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
029: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
030: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
031: */
032:
033: package com.jeantessier.dependencyfinder;
034:
035: import java.io.*;
036:
037: public class NullPrintWriter extends PrintWriter {
038: private static final Writer NULL_WRITER = new StringWriter();
039:
040: public NullPrintWriter() {
041: super (NULL_WRITER);
042: }
043:
044: public void flush() {
045: // Do nothing
046: }
047:
048: public void close() {
049: // Do nothing
050: }
051:
052: public boolean checkError() {
053: return false;
054: }
055:
056: protected void setError() {
057: // Do nothing
058: }
059:
060: public void write(int c) {
061: // Do nothing
062: }
063:
064: public void write(char[] buf, int off, int len) {
065: // Do nothing
066: }
067:
068: public void write(char[] buf) {
069: // Do nothing
070: }
071:
072: public void write(String s, int off, int len) {
073: // Do nothing
074: }
075:
076: public void write(String s) {
077: // Do nothing
078: }
079:
080: public void print(boolean b) {
081: // Do nothing
082: }
083:
084: public void print(char c) {
085: // Do nothing
086: }
087:
088: public void print(int i) {
089: // Do nothing
090: }
091:
092: public void print(long l) {
093: // Do nothing
094: }
095:
096: public void print(float f) {
097: // Do nothing
098: }
099:
100: public void print(double d) {
101: // Do nothing
102: }
103:
104: public void print(char[] s) {
105: // Do nothing
106: }
107:
108: public void print(String s) {
109: // Do nothing
110: }
111:
112: public void print(Object obj) {
113: // Do nothing
114: }
115:
116: public void println() {
117: // Do nothing
118: }
119:
120: public void println(boolean x) {
121: // Do nothing
122: }
123:
124: public void println(char x) {
125: // Do nothing
126: }
127:
128: public void println(int x) {
129: // Do nothing
130: }
131:
132: public void println(long x) {
133: // Do nothing
134: }
135:
136: public void println(float x) {
137: // Do nothing
138: }
139:
140: public void println(double x) {
141: // Do nothing
142: }
143:
144: public void println(char[] x) {
145: // Do nothing
146: }
147:
148: public void println(String x) {
149: // Do nothing
150: }
151:
152: public void println(Object x) {
153: // Do nothing
154: }
155: }
|