annotate NGSrich_0.5.5/src/org/jdom/JDOMFactory.java @ 0:89ad0a9cca52 default tip

Uploaded
author pfrommolt
date Mon, 21 Nov 2011 08:12:19 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
1 /*--
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
2
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
3 $Id: JDOMFactory.java,v 1.9 2007/11/10 05:28:59 jhunter Exp $
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
4
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
5 Copyright (C) 2000-2007 Jason Hunter & Brett McLaughlin.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
6 All rights reserved.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
7
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
8 Redistribution and use in source and binary forms, with or without
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
9 modification, are permitted provided that the following conditions
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
10 are met:
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
11
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
12 1. Redistributions of source code must retain the above copyright
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
13 notice, this list of conditions, and the following disclaimer.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
14
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
15 2. Redistributions in binary form must reproduce the above copyright
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
16 notice, this list of conditions, and the disclaimer that follows
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
17 these conditions in the documentation and/or other materials
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
18 provided with the distribution.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
19
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
20 3. The name "JDOM" must not be used to endorse or promote products
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
21 derived from this software without prior written permission. For
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
22 written permission, please contact <request_AT_jdom_DOT_org>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
23
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
24 4. Products derived from this software may not be called "JDOM", nor
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
25 may "JDOM" appear in their name, without prior written permission
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
26 from the JDOM Project Management <request_AT_jdom_DOT_org>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
27
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
28 In addition, we request (but do not require) that you include in the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
29 end-user documentation provided with the redistribution and/or in the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
30 software itself an acknowledgement equivalent to the following:
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
31 "This product includes software developed by the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
32 JDOM Project (http://www.jdom.org/)."
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
33 Alternatively, the acknowledgment may be graphical using the logos
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
34 available at http://www.jdom.org/images/logos.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
35
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
36 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
37 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
38 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
39 DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
40 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
41 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
42 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
43 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
44 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
45 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
46 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
47 SUCH DAMAGE.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
48
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
49 This software consists of voluntary contributions made by many
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
50 individuals on behalf of the JDOM Project and was originally
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
51 created by Jason Hunter <jhunter_AT_jdom_DOT_org> and
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
52 Brett McLaughlin <brett_AT_jdom_DOT_org>. For more information
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
53 on the JDOM Project, please see <http://www.jdom.org/>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
54
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
55 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
56
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
57 package org.jdom;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
58
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
59 import java.util.*;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
60
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
61 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
62 * An interface to be used by builders when constructing JDOM objects. The
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
63 * <code>DefaultJDOMFactory</code> creates the standard top-level JDOM classes
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
64 * (Element, Document, Comment, etc). Another implementation of this factory
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
65 * could be used to create custom classes.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
66 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
67 * @version $Revision: 1.9 $, $Date: 2007/11/10 05:28:59 $
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
68 * @author Ken Rune Holland
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
69 * @author Phil Nelson
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
70 * @author Bradley S. Huffman
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
71 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
72 public interface JDOMFactory {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
73
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
74 // **** constructing Attributes ****
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
75
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
76 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
77 * <p>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
78 * This will create a new <code>Attribute</code> with the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
79 * specified (local) name and value, and in the provided
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
80 * <code>{@link org.jdom.Namespace}</code>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
81 * </p>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
82 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
83 * @param name <code>String</code> name of <code>Attribute</code>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
84 * @param value <code>String</code> value for new attribute.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
85 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
86 public Attribute attribute(String name, String value, Namespace namespace);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
87
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
88 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
89 * This will create a new <code>Attribute</code> with the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
90 * specified (local) name, value, and type, and in the provided
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
91 * <code>{@link org.jdom.Namespace}</code>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
92 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
93 * @param name <code>String</code> name of <code>Attribute</code>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
94 * @param value <code>String</code> value for new attribute.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
95 * @param type <code>int</code> type for new attribute.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
96 * @param namespace <code>Namespace</code> namespace for new attribute.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
97 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
98 public Attribute attribute(String name, String value,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
99 int type, Namespace namespace);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
100
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
101 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
102 * This will create a new <code>Attribute</code> with the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
103 * specified (local) name and value, and does not place
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
104 * the attribute in a <code>{@link org.jdom.Namespace}</code>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
105 * <p>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
106 * <b>Note</b>: This actually explicitly puts the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
107 * <code>Attribute</code> in the "empty" <code>Namespace</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
108 * (<code>{@link org.jdom.Namespace#NO_NAMESPACE}</code>).
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
109 * </p>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
110 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
111 * @param name <code>String</code> name of <code>Attribute</code>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
112 * @param value <code>String</code> value for new attribute.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
113 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
114 public Attribute attribute(String name, String value);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
115
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
116 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
117 * This will create a new <code>Attribute</code> with the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
118 * specified (local) name, value and type, and does not place
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
119 * the attribute in a <code>{@link org.jdom.Namespace}</code>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
120 * <p>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
121 * <b>Note</b>: This actually explicitly puts the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
122 * <code>Attribute</code> in the "empty" <code>Namespace</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
123 * (<code>{@link org.jdom.Namespace#NO_NAMESPACE}</code>).
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
124 * </p>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
125 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
126 * @param name <code>String</code> name of <code>Attribute</code>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
127 * @param value <code>String</code> value for new attribute.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
128 * @param type <code>int</code> type for new attribute.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
129 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
130 public Attribute attribute(String name, String value, int type);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
131
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
132 // **** constructing CDATA ****
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
133
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
134 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
135 * This creates the CDATA with the supplied text.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
136 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
137 * @param str <code>String</code> content of CDATA.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
138 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
139 public CDATA cdata(String str);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
140
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
141 // **** constructing Text ****
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
142
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
143 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
144 * This creates the Text with the supplied text.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
145 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
146 * @param str <code>String</code> content of Text.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
147 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
148 public Text text(String str);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
149
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
150 // **** constructing Comment ****
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
151
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
152 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
153 * This creates the comment with the supplied text.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
154 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
155 * @param text <code>String</code> content of comment.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
156 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
157 public Comment comment(String text);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
158
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
159 // **** constructing DocType
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
160
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
161 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
162 * This will create the <code>DocType</code> with
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
163 * the specified element name and a reference to an
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
164 * external DTD.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
165 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
166 * @param elementName <code>String</code> name of
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
167 * element being constrained.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
168 * @param publicID <code>String</code> public ID of
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
169 * referenced DTD
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
170 * @param systemID <code>String</code> system ID of
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
171 * referenced DTD
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
172 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
173 public DocType docType(String elementName,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
174 String publicID, String systemID);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
175
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
176 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
177 * This will create the <code>DocType</code> with
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
178 * the specified element name and reference to an
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
179 * external DTD.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
180 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
181 * @param elementName <code>String</code> name of
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
182 * element being constrained.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
183 * @param systemID <code>String</code> system ID of
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
184 * referenced DTD
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
185 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
186 public DocType docType(String elementName, String systemID);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
187
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
188 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
189 * This will create the <code>DocType</code> with
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
190 * the specified element name
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
191 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
192 * @param elementName <code>String</code> name of
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
193 * element being constrained.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
194 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
195 public DocType docType(String elementName);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
196
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
197 // **** constructing Document
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
198
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
199 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
200 * This will create a new <code>Document</code>,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
201 * with the supplied <code>{@link org.jdom.Element}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
202 * as the root element and the supplied
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
203 * <code>{@link org.jdom.DocType}</code> declaration.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
204 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
205 * @param rootElement <code>Element</code> for document root.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
206 * @param docType <code>DocType</code> declaration.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
207 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
208 public Document document(Element rootElement, DocType docType);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
209
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
210 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
211 * This will create a new <code>Document</code>,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
212 * with the supplied <code>{@link org.jdom.Element}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
213 * as the root element and the supplied
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
214 * <code>{@link org.jdom.DocType}</code> declaration.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
215 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
216 * @param rootElement <code>Element</code> for document root.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
217 * @param docType <code>DocType</code> declaration.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
218 * @param baseURI the URI from which this doucment was loaded.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
219 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
220 public Document document(Element rootElement, DocType docType, String baseURI);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
221
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
222 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
223 * This will create a new <code>Document</code>,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
224 * with the supplied <code>{@link org.jdom.Element}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
225 * as the root element, and no <code>{@link org.jdom.DocType}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
226 * declaration.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
227 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
228 * @param rootElement <code>Element</code> for document root
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
229 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
230 public Document document(Element rootElement);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
231
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
232 // **** constructing Elements ****
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
233
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
234 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
235 * This will create a new <code>Element</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
236 * with the supplied (local) name, and define
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
237 * the <code>{@link org.jdom.Namespace}</code> to be used.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
238 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
239 * @param name <code>String</code> name of element.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
240 * @param namespace <code>Namespace</code> to put element in.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
241 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
242 public Element element(String name, Namespace namespace);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
243
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
244 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
245 * This will create an <code>Element</code> in no
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
246 * <code>{@link org.jdom.Namespace}</code>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
247 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
248 * @param name <code>String</code> name of element.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
249 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
250 public Element element(String name);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
251
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
252 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
253 * This will create a new <code>Element</code> with
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
254 * the supplied (local) name, and specifies the URI
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
255 * of the <code>{@link org.jdom.Namespace}</code> the <code>Element</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
256 * should be in, resulting it being unprefixed (in the default
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
257 * namespace).
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
258 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
259 * @param name <code>String</code> name of element.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
260 * @param uri <code>String</code> URI for <code>Namespace</code> element
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
261 * should be in.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
262 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
263 public Element element(String name, String uri);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
264
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
265 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
266 * This will create a new <code>Element</code> with
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
267 * the supplied (local) name, and specifies the prefix and URI
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
268 * of the <code>{@link org.jdom.Namespace}</code> the <code>Element</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
269 * should be in.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
270 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
271 * @param name <code>String</code> name of element.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
272 * @param uri <code>String</code> URI for <code>Namespace</code> element
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
273 * should be in.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
274 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
275 public Element element(String name, String prefix, String uri);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
276
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
277 // **** constructing ProcessingInstruction ****
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
278
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
279 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
280 * This will create a new <code>ProcessingInstruction</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
281 * with the specified target and data.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
282 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
283 * @param target <code>String</code> target of PI.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
284 * @param data <code>Map</code> data for PI, in
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
285 * name/value pairs
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
286 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
287 public ProcessingInstruction processingInstruction(String target,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
288 Map data);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
289
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
290 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
291 * This will create a new <code>ProcessingInstruction</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
292 * with the specified target and data.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
293 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
294 * @param target <code>String</code> target of PI.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
295 * @param data <code>String</code> data for PI.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
296 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
297 public ProcessingInstruction processingInstruction(String target,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
298 String data);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
299
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
300 // **** constructing EntityRef ****
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
301
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
302 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
303 * This will create a new <code>EntityRef</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
304 * with the supplied name.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
305 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
306 * @param name <code>String</code> name of element.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
307 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
308 public EntityRef entityRef(String name);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
309
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
310 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
311 * This will create a new <code>EntityRef</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
312 * with the supplied name, public ID, and system ID.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
313 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
314 * @param name <code>String</code> name of element.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
315 * @param publicID <code>String</code> public ID of element.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
316 * @param systemID <code>String</code> system ID of element.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
317 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
318 public EntityRef entityRef(String name, String publicID, String systemID);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
319
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
320 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
321 * This will create a new <code>EntityRef</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
322 * with the supplied name and system ID.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
323 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
324 * @param name <code>String</code> name of element.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
325 * @param systemID <code>String</code> system ID of element.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
326 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
327 public EntityRef entityRef(String name, String systemID);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
328
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
329 // =====================================================================
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
330 // List manipulation
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
331 // =====================================================================
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
332
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
333 public void addContent(Parent parent, Content content);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
334
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
335 public void setAttribute(Element element, Attribute a);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
336
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
337 public void addNamespaceDeclaration(Element element, Namespace additional);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
338 }