annotate NGSrich_0.5.5/src/org/jdom/IllegalAddException.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: IllegalAddException.java,v 1.26 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 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
60 * Thrown when trying to add a illegal object to a JDOM construct.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
61 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
62 * @version $Revision: 1.26 $, $Date: 2007/11/10 05:28:59 $
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
63 * @author Brett McLaughlin
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
64 * @author Jason Hunter
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
65 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
66 public class IllegalAddException extends IllegalArgumentException {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
67
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
68 private static final String CVS_ID =
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
69 "@(#) $RCSfile: IllegalAddException.java,v $ $Revision: 1.26 $ $Date: 2007/11/10 05:28:59 $ $Name: jdom_1_1_1 $";
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
70
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
71 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
72 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
73 * that the addition of the <code>{@link Attribute}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
74 * to the <code>{@link Element}</code> is illegal.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
75 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
76 * @param base <code>Element</code> that <code>Attribute</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
77 * couldn't be added to
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
78 * @param added <code>Attribute</code> that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
79 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
80 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
81 IllegalAddException(Element base, Attribute added, String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
82 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
83 .append("The attribute \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
84 .append(added.getQualifiedName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
85 .append("\" could not be added to the element \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
86 .append(base.getQualifiedName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
87 .append("\": ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
88 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
89 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
90 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
91
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
92 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
93 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
94 * that the addition of the <code>{@link Element}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
95 * to parent is illegal.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
96 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
97 * @param base <code>Element</code> that the child
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
98 * couldn't be added to
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
99 * @param added <code>Element</code> that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
100 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
101 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
102 IllegalAddException(Element base, Element added, String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
103 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
104 .append("The element \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
105 .append(added.getQualifiedName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
106 .append("\" could not be added as a child of \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
107 .append(base.getQualifiedName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
108 .append("\": ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
109 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
110 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
111 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
112
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
113 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
114 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
115 * that the addition of the <code>{@link Element}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
116 * to the <code>{@link Document}</code> is illegal.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
117 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
118 * @param added <code>Element</code> that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
119 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
120 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
121 IllegalAddException(Element added, String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
122 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
123 .append("The element \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
124 .append(added.getQualifiedName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
125 .append("\" could not be added as the root of the document: ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
126 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
127 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
128 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
129
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
130 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
131 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
132 * that the addition of the <code>{@link ProcessingInstruction}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
133 * to the <code>{@link Element}</code> is illegal.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
134 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
135 * @param base <code>Element</code> that the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
136 * <code>ProcessingInstruction</code> couldn't be added to
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
137 * @param added <code>ProcessingInstruction</code> that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
138 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
139 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
140 IllegalAddException(Element base, ProcessingInstruction added,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
141 String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
142 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
143 .append("The PI \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
144 .append(added.getTarget())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
145 .append("\" could not be added as content to \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
146 .append(base.getQualifiedName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
147 .append("\": ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
148 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
149 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
150 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
151
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
152 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
153 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
154 * that the addition of the <code>{@link ProcessingInstruction}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
155 * to the <code>{@link Document}</code> is illegal.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
156 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
157 * @param added <code>ProcessingInstruction</code> that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
158 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
159 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
160 IllegalAddException(ProcessingInstruction added,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
161 String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
162 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
163 .append("The PI \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
164 .append(added.getTarget())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
165 .append("\" could not be added to the top level of the document: ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
166 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
167 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
168 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
169
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
170 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
171 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
172 * that the addition of the <code>{@link Comment}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
173 * to the <code>{@link Element}</code> is illegal.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
174 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
175 * @param base <code>Element</code> that the <code>Comment</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
176 * couldn't be added to
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
177 * @param added <code>Comment</code> that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
178 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
179 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
180 IllegalAddException(Element base, Comment added, String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
181 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
182 .append("The comment \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
183 .append(added.getText())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
184 .append("\" could not be added as content to \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
185 .append(base.getQualifiedName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
186 .append("\": ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
187 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
188 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
189 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
190
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
191
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
192 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
193 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
194 * that the addition of the <code>{@link CDATA}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
195 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
196 * @param base <code>Element</code> that the <code>CDATA</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
197 * couldn't be added to
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
198 * @param added <code>CDATA</code> that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
199 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
200 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
201 IllegalAddException(Element base, CDATA added, String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
202 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
203 .append("The CDATA \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
204 .append(added.getText())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
205 .append("\" could not be added as content to \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
206 .append(base.getQualifiedName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
207 .append("\": ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
208 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
209 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
210 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
211
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
212
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
213 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
214 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
215 * that the addition of the <code>{@link Text}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
216 * to the <code>{@link Element}</code> is illegal.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
217 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
218 * @param base <code>Element</code> that the <code>Comment</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
219 * couldn't be added to
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
220 * @param added <code>Text</code> that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
221 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
222 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
223 IllegalAddException(Element base, Text added, String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
224 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
225 .append("The Text \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
226 .append(added.getText())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
227 .append("\" could not be added as content to \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
228 .append(base.getQualifiedName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
229 .append("\": ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
230 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
231 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
232 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
233
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
234 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
235 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
236 * that the addition of the <code>{@link Comment}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
237 * to the <code>{@link Document}</code> is illegal.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
238 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
239 * @param added <code>Comment</code> that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
240 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
241 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
242 IllegalAddException(Comment added, String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
243 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
244 .append("The comment \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
245 .append(added.getText())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
246 .append("\" could not be added to the top level of the document: ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
247 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
248 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
249 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
250
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
251 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
252 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
253 * that the addition of the <code>{@link EntityRef}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
254 * to the <code>{@link Element}</code> is illegal.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
255 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
256 * @param base <code>Element</code> that the <code>EntityRef</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
257 * couldn't be added to
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
258 * @param added <code>EntityRef</code> reference that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
259 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
260 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
261 IllegalAddException(Element base, EntityRef added, String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
262 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
263 .append("The entity reference\"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
264 .append(added.getName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
265 .append("\" could not be added as content to \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
266 .append(base.getQualifiedName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
267 .append("\": ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
268 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
269 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
270 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
271
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
272 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
273 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
274 * that the addition of the <code>{@link Namespace}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
275 * to the <code>{@link Element}</code> is illegal.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
276 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
277 * @param base <code>Element</code> that the <code>Namespace</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
278 * couldn't be added to
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
279 * @param added <code>Namespace</code> that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
280 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
281 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
282 IllegalAddException(Element base, Namespace added, String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
283 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
284 .append("The namespace xmlns")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
285 .append((added.getPrefix() == null ||
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
286 added.getPrefix().equals("")) ? "="
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
287 : ":" + added.getPrefix() + "=")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
288 .append("\"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
289 .append(added.getURI())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
290 .append("\" could not be added as a namespace to \"")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
291 .append(base.getQualifiedName())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
292 .append("\": ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
293 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
294 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
295 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
296
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
297 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
298 * This will create an <code>Exception</code> indicating
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
299 * that the addition of the <code>{@link DocType}</code>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
300 * to the <code>{@link Document}</code> is illegal.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
301 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
302 * @param added <code>DocType</code> that could not be added
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
303 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
304 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
305 IllegalAddException(DocType added, String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
306 super(new StringBuffer()
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
307 .append("The DOCTYPE ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
308 .append(added.toString())
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
309 .append(" could not be added to the document: ")
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
310 .append(reason)
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
311 .toString());
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
312 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
313
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
314 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
315 * This will create an <code>Exception</code> with the specified
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
316 * error message.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
317 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
318 * @param reason cause of the problem
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
319 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
320 public IllegalAddException(String reason) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
321 super(reason);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
322 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
323 }