01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id: TabbingPrintWriter.java 3515 2006-12-08 06:00:36Z yling $
23: */
24: package com.bostechcorp.cbesb.common.util;
25:
26: import java.io.File;
27: import java.io.FileNotFoundException;
28: import java.io.PrintWriter;
29:
30: /*
31: * This printwriter is used to output the java code.
32: * It has the ability to automaticlaly insert tabs
33: */
34: public class TabbingPrintWriter extends PrintWriter {
35: public TabbingPrintWriter(File f) throws FileNotFoundException {
36: super (f);
37: }
38:
39: public void print(String s) {
40: super .print(_tabs + s);
41: }
42:
43: public void printNoTab(String s) {
44: super .print(s);
45: }
46:
47: public void println(String s) {
48: super .println(_tabs + s);
49: }
50:
51: public void printlnNoTab(String s) {
52: super .println(s);
53: }
54:
55: public void addTab() {
56: _tabs = _tabs.concat(" ");
57: }
58:
59: public void delTab() {
60: _tabs = _tabs.substring(0, _tabs.length() - 2);
61: }
62:
63: String _tabs = "";
64: }
|