KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
23  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
24  * @version $Id: IndentationEngine.java,v 1.2 2004/02/16 23:39:55 jochen Exp $
25  */

26 public interface IndentationEngine {
27   public static final Object JavaDoc NOTHING = "";
28
29   /** <p>Increases the current level of indentation.</p>
30    */

31   public void indent();
32   /** <p>Decreases the current level of indentation.</p>
33    */

34   public void unindent();
35
36   /** <p>Adds the IndentationEngine's contents to the given
37    * {@link IndentationTarget}.</p>
38    */

39   public void write(IndentationTarget pTarget) throws IOException JavaDoc;
40
41   /** <p>Adds the given objects contents to the given
42    * {@link IndentationTarget}.</p>
43    */

44   public void write(IndentationTarget pTarget, Object JavaDoc pObject) throws IOException JavaDoc;
45
46   /** <p>Clears the IndentationEngine's contents.</p>
47    */

48   public void clear();
49   /** <p>Sets the current level of indentation.</p>
50    */

51   public void setLevel(int pLevel);
52   /** <p>Returns the current level of indentation.</p>
53    */

54   public int getLevel();
55
56   /** <p>Adds the given tokens as a complete line, using the
57    * given level of indentation.</p>
58    */

59   public void addLine(int pLevel, Object JavaDoc[] pTokens);
60   /** <p>Shortcut for <code>addLine(getIndentationLevel(), pTokens)</code>.</p>
61    */

62   public void addLine(Object JavaDoc[] pTokens);
63   /** <p>Adds an empty line, shortcut for
64    * <code>addLine(getIndentationLevel, new Object[0])</<code>.</p>
65    */

66   public void addLine();
67   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
68    * new Object[]{pLine})</code>.</p>
69    */

70   public void addLine(Object JavaDoc pLine);
71   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
72    * new Object[]{pToken1, pToken2})</code>.</p>
73    */

74   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2);
75   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
76    * new Object[]{pToken1, pToken2, pToken3})</code>.</p>
77    */

78   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3);
79   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
80    * new Object[]{pToken1, pToken2, pToken3, pToken4})</code>.</p>
81    */

82   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
83                        Object JavaDoc pToken4);
84   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
85    * new Object[]{pToken1, pToken2, pToken3, pToken4, pToken5})</code>.</p>
86    */

87   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
88                        Object JavaDoc pToken4, Object JavaDoc pToken5);
89   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
90    * new Object[]{pToken1, pToken2, pToken3, pToken4, pToken5,
91    * pToken6}) </code>.</p>
92    */

93   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
94                        Object JavaDoc pToken4, Object JavaDoc pToken5, Object JavaDoc pToken6);
95   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
96    * new Object[]{pToken1, pToken2, pToken3, pToken4, pToken5,
97    * pToken6, pToken7}) </code>.</p>
98    */

99   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
100                        Object JavaDoc pToken4, Object JavaDoc pToken5, Object JavaDoc pToken6,
101                        Object JavaDoc pToken7);
102   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
103    * new Object[]{pToken1, pToken2, pToken3, pToken4, pToken5,
104    * pToken6, pToken7, pToken8}) </code>.</p>
105    */

106   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
107                        Object JavaDoc pToken4, Object JavaDoc pToken5, Object JavaDoc pToken6,
108                        Object JavaDoc pToken7, Object JavaDoc pToken8);
109   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
110    * new Object[]{pToken1, pToken2, pToken3, pToken4, pToken5,
111    * pToken6, pToken7, pToken8, pToken9}) </code>.</p>
112    */

113   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
114                        Object JavaDoc pToken4, Object JavaDoc pToken5, Object JavaDoc pToken6,
115                        Object JavaDoc pToken7, Object JavaDoc pToken8, Object JavaDoc pToken9);
116   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
117    * new Object[]{pToken1, pToken2, pToken3, pToken4, pToken5,
118    * pToken6, pToken7, pToken8, pToken9, pToken10}) </code>.</p>
119    */

120   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
121                        Object JavaDoc pToken4, Object JavaDoc pToken5, Object JavaDoc pToken6,
122                        Object JavaDoc pToken7, Object JavaDoc pToken8, Object JavaDoc pToken9,
123                        Object JavaDoc pToken10);
124   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
125    * new Object[]{pToken1, pToken2, pToken3, pToken4, pToken5,
126    * pToken6, pToken7, pToken8, pToken9, pToken10,
127    * pToken11}) </code>.</p>
128    */

129   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
130                        Object JavaDoc pToken4, Object JavaDoc pToken5, Object JavaDoc pToken6,
131                        Object JavaDoc pToken7, Object JavaDoc pToken8, Object JavaDoc pToken9,
132                        Object JavaDoc pToken10, Object JavaDoc pToken11);
133   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
134    * new Object[]{pToken1, pToken2, pToken3, pToken4, pToken5,
135    * pToken6, pToken7, pToken8, pToken9, pToken10,
136    * pToken11, pToken12}) </code>.</p>
137    */

138   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
139                        Object JavaDoc pToken4, Object JavaDoc pToken5, Object JavaDoc pToken6,
140                        Object JavaDoc pToken7, Object JavaDoc pToken8, Object JavaDoc pToken9,
141                        Object JavaDoc pToken10, Object JavaDoc pToken11, Object JavaDoc pToken12);
142   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
143    * new Object[]{pToken1, pToken2, pToken3, pToken4, pToken5,
144    * pToken6, pToken7, pToken8, pToken9, pToken10,
145    * pToken11, pToken12, pToken13}) </code>.</p>
146    */

147   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
148                        Object JavaDoc pToken4, Object JavaDoc pToken5, Object JavaDoc pToken6,
149                        Object JavaDoc pToken7, Object JavaDoc pToken8, Object JavaDoc pToken9,
150                        Object JavaDoc pToken10, Object JavaDoc pToken11, Object JavaDoc pToken12,
151                        Object JavaDoc pToken13);
152   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
153    * new Object[]{pToken1, pToken2, pToken3, pToken4, pToken5,
154    * pToken6, pToken7, pToken8, pToken9, pToken10,
155    * pToken11, pToken12, pToken13, pToken14}) </code>.</p>
156    */

157   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
158                        Object JavaDoc pToken4, Object JavaDoc pToken5, Object JavaDoc pToken6,
159                        Object JavaDoc pToken7, Object JavaDoc pToken8, Object JavaDoc pToken9,
160                        Object JavaDoc pToken10, Object JavaDoc pToken11, Object JavaDoc pToken12,
161                        Object JavaDoc pToken13, Object JavaDoc pToken14);
162   /** <p>Shortcut for <code>addLine(getIndentationLevel(),
163    * new Object[]{pToken1, pToken2, pToken3, pToken4, pToken5,
164    * pToken6, pToken7, pToken8, pToken9, pToken10,
165    * pToken11, pToken12, pToken13, pToken15}) </code>.</p>
166    */

167   public void addLine(Object JavaDoc pToken1, Object JavaDoc pToken2, Object JavaDoc pToken3,
168                        Object JavaDoc pToken4, Object JavaDoc pToken5, Object JavaDoc pToken6,
169                        Object JavaDoc pToken7, Object JavaDoc pToken8, Object JavaDoc pToken9,
170                        Object JavaDoc pToken10, Object JavaDoc pToken11, Object JavaDoc pToken12,
171                        Object JavaDoc pToken13, Object JavaDoc pToken14, Object JavaDoc pToken15);
172
173   /** <p>Moves the cursor to the top of the method.</p>
174    */

175   public void moveToTop();
176
177   /** <p>Moves the cursor to the bottom of the method.</p>
178    */

179   public void moveToBottom();
180
181   /** <p>Sets a placeholder with the given name.</p>
182    * @param pName The placeholders name
183    * @param pAutoRemove Whether the placeholder must be removed by invoking {@link PlaceHolder#remove()} (false)
184    * or not (true).
185    */

186   public PlaceHolder newPlaceHolder(String JavaDoc pName, boolean pAutoRemove);
187
188   /** <p>Searches for the placeholder with the given name. The cursor
189    * will be set to the line after the placeholder, if it is found.
190    * In that case subsequent invocations of {@link IndentationEngine#addLine()}
191    * will add code to the lines following the placeholder. Otherwise
192    * the cursor is unchanged.</p>
193    * @param pName The placeholders name
194    * @return The placeholder or null, if it wasn't found.
195    */

196   public PlaceHolder getPlaceHolder(String JavaDoc pName);
197 }
198
Popular Tags