01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.dev.jjs.impl;
17:
18: import com.google.gwt.dev.jjs.ast.JVisitor;
19: import com.google.gwt.dev.util.TextOutput;
20:
21: /**
22: * A convenience base class that combines a {@link JVisitor} with a
23: * {@link TextOutput}.
24: */
25: public class TextOutputVisitor extends JVisitor implements TextOutput {
26:
27: private final TextOutput textOutput;
28:
29: public TextOutputVisitor(TextOutput textOutput) {
30: this .textOutput = textOutput;
31: }
32:
33: public void indentIn() {
34: textOutput.indentIn();
35: }
36:
37: public void indentOut() {
38: textOutput.indentOut();
39: }
40:
41: public void newline() {
42: textOutput.newline();
43: }
44:
45: public void newlineOpt() {
46: textOutput.newlineOpt();
47: }
48:
49: public void print(char c) {
50: textOutput.print(c);
51: }
52:
53: public void print(char[] s) {
54: textOutput.print(s);
55: }
56:
57: public void print(String s) {
58: textOutput.print(s);
59: }
60:
61: public void printOpt(char c) {
62: textOutput.printOpt(c);
63: }
64:
65: public void printOpt(char[] s) {
66: textOutput.printOpt(s);
67: }
68:
69: public void printOpt(String s) {
70: textOutput.printOpt(s);
71: }
72: }
|