KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > js > IncreasingTarget


1 /*
2  * Copyright 2003, 2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15
16  */

17 package org.apache.ws.jaxme.js;
18
19 import java.io.IOException JavaDoc;
20
21
22 /** <p>A filtering indentation target, which pipes all output
23  * to the actual target, except that it increases the indentation
24  * level by 1.</p>
25  *
26  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
27  * @version $Id: IncreasingTarget.java,v 1.2 2004/02/16 23:39:55 jochen Exp $
28  */

29 public class IncreasingTarget implements IndentationTarget {
30   private IndentationTarget actualTarget;
31   private Boolean JavaDoc isInterface;
32   public IncreasingTarget(IndentationTarget pActualTarget) {
33     actualTarget = pActualTarget;
34   }
35   public boolean isInterface() {
36      return (isInterface == null) ? actualTarget.isInterface() : isInterface.booleanValue();
37   }
38   public void setInterface(Boolean JavaDoc pInterface) {
39      isInterface = pInterface;
40   }
41   public void indent(int i) throws IOException JavaDoc {
42     actualTarget.indent(i+1);
43   }
44   public String JavaDoc asString(JavaQName pQName) {
45     return actualTarget.asString(pQName);
46   }
47   public void write(String JavaDoc pValue) throws IOException JavaDoc {
48     actualTarget.write(pValue);
49   }
50   public void write() throws IOException JavaDoc {
51     actualTarget.write();
52   }
53 }
54
Popular Tags