KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ecs > Element


1 /*
2  * ====================================================================
3  *
4  * The Apache Software License, Version 1.1
5  *
6  * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
7  * reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in
18  * the documentation and/or other materials provided with the
19  * distribution.
20  *
21  * 3. The end-user documentation included with the redistribution, if
22  * any, must include the following acknowlegement:
23  * "This product includes software developed by the
24  * Apache Software Foundation (http://www.apache.org/)."
25  * Alternately, this acknowlegement may appear in the software itself,
26  * if and wherever such third-party acknowlegements normally appear.
27  *
28  * 4. The names "The Jakarta Project", "Jakarta Element Construction Set",
29  * "Jakarta ECS" , and "Apache Software Foundation" must not be used
30  * to endorse or promote products derived
31  * from this software without prior written permission. For written
32  * permission, please contact apache@apache.org.
33  *
34  * 5. Products derived from this software may not be called "Apache",
35  * "Jakarta Element Construction Set" nor "Jakarta ECS" nor may "Apache"
36  * appear in their names without prior written permission of the Apache Group.
37  *
38  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
39  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
40  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
42  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
45  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
46  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
48  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49  * SUCH DAMAGE.
50  * ====================================================================
51  *
52  * This software consists of voluntary contributions made by many
53  * individuals on behalf of the Apache Software Foundation. For more
54  * information on the Apache Software Foundation, please see
55  * <http://www.apache.org/>.
56  *
57  */

58 package org.apache.ecs;
59
60 import java.io.OutputStream JavaDoc;
61 import java.io.PrintWriter JavaDoc;
62
63 /**
64     This class describes an ElementFactory.
65
66     @version $Id: Element.java,v 1.4 2003/04/27 09:43:24 rdonkin Exp $
67     @author <a HREF="mailto:snagy@servletapi.com">Stephan Nagy</a>
68     @author <a HREF="mailto:jon@clearink.com">Jon S. Stevens</a>
69 */

70 public interface Element extends ElementRegistry
71 {
72     /**
73         Element to be rendered in all CAPS
74     */

75     public static final int UPPERCASE = 1;
76
77     /**
78         Element to be rendered in all lowercase
79     */

80     public static final int LOWERCASE = 2;
81
82     /**
83         Element to be rendered as specified by subclass
84     */

85     public static final int MIXEDCASE = 3;
86
87     /**
88         Element tag to be rendered to the center of start_tag end_tag &lt;_tag&gt; <br>
89         This is the default.
90     */

91     public static final int CENTER = 4;
92
93     /**
94         Element tag to be rendered to the left of start_tag end_tag _tag&lt;&gt;
95     */

96     public static final int LEFT = 5;
97
98     /**
99         Element tag to be rendered to the right of start_tag end_tag &lt;&gt;_tag
100     */

101     public static final int RIGHT = 6;
102
103     /**
104         Set case type
105     */

106     public void setCase(int type);
107
108     /**
109         Used to determine case setting
110     */

111     public int getCase();
112
113     /**
114         Get the version number of this codebase
115     */

116     public String JavaDoc getVersion();
117
118     /**
119         Set the HtmlElement type
120     */

121     public void setElementType(String JavaDoc element_type);
122
123     /**
124         Get the HtmlElement type
125     */

126     public String JavaDoc getElementType();
127
128     /**
129         Set wether or not this Element needs a closing tag
130     */

131     public void setNeedClosingTag(boolean close_tag);
132
133     /**
134         Get whether or not this Element needs a closing tag
135     */

136     public boolean getNeedClosingTag();
137
138     /**
139         Determine if this element needs a line break, if pretty printing.
140     */

141     public boolean getNeedLineBreak();
142
143     /**
144         Set tag position. ElementFactory CENTER | LEFT | RIGHT
145     */

146     public void setTagPosition(int position);
147
148     /**
149         Get tag position. How is the element supposed to be rendered.
150     */

151     public int getTagPosition();
152
153     /**
154         Set the start tag character.
155     */

156     public void setStartTagChar(char start_tag);
157
158     /**
159         Get the start tag character.
160     */

161     public char getStartTagChar();
162
163     /**
164         Set the end tag character.
165     */

166     public void setEndTagChar(char end_tag);
167
168     /**
169         Get the end tag character.
170     */

171     public char getEndTagChar();
172
173     /*
174         Set a modifer for the start of the tag.
175     */

176     public Element setBeginStartModifier(char start_modifier);
177
178     /**
179         Get a modifier for the start of the tag if one exists.
180     */

181     public char getBeginStartModifier();
182
183     /**
184         Set a modifer for the end of the tag.
185     */

186     public Element setBeginEndModifier(char start_modifier);
187
188     /**
189         Get the modifier for the end of the tag if one exists.
190     */

191     public char getBeginEndModifier();
192
193     /*
194         Set a modifer for the start of the tag.
195     */

196     public Element setEndStartModifier(char start_modifier);
197
198     /**
199         Get a modifier for the start of the tag if one exists.
200     */

201     public char getEndStartModifier();
202
203     /**
204         Set a modifer for the end of the tag.
205     */

206     public Element setEndEndModifier(char start_modifier);
207
208     /**
209         Get the modifier for the end of the tag if one exists.
210     */

211     public char getEndEndModifier();
212
213     /**
214         Set the filter state of the element.
215     */

216     public Element setFilterState(boolean state);
217
218     /**
219         Get the filter state of the element.
220     */

221     public boolean getFilterState();
222
223     /**
224         Set the prettyPrint state of the element.
225     */

226     public Element setPrettyPrint(boolean pretty_print);
227
228     /**
229         Get the prettyPrint state of the element.
230     */

231     public boolean getPrettyPrint();
232
233     /**
234         Set the tab level for pretty printing
235     */

236     public void setTabLevel(int tabLevel);
237
238     /**
239         Get the tab level for pretty printing.
240     */

241     
242     public int getTabLevel();
243
244     /**
245         Provide a way to output the element to a stream.
246     */

247     public void output(OutputStream JavaDoc out);
248
249     /**
250         Provide a way to output the element to a PrintWriter.
251     */

252     public void output(PrintWriter JavaDoc out);
253
254 }
255
Popular Tags