1 /* |
1 /* |
2 * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
92 throws SAXException; |
92 throws SAXException; |
93 |
93 |
94 /** |
94 /** |
95 * Receive notification of an external parsed general entity |
95 * Receive notification of an external parsed general entity |
96 * declaration event. |
96 * declaration event. |
97 * <p/> |
97 * <p> |
98 * <p>If a system identifier is present, and it is a relative URL, the |
98 * <p>If a system identifier is present, and it is a relative URL, the |
99 * parser will have resolved it fully before passing it through this |
99 * parser will have resolved it fully before passing it through this |
100 * method to a listener.</p> |
100 * method to a listener.</p> |
101 * |
101 * |
102 * @param name The entity name. |
102 * @param name The entity name. |
125 throws SAXException; |
125 throws SAXException; |
126 |
126 |
127 /** |
127 /** |
128 * Receive notification of an external parameter entity declaration |
128 * Receive notification of an external parameter entity declaration |
129 * event. |
129 * event. |
130 * <p/> |
130 * <p> |
131 * <p>If a system identifier is present, and it is a relative URL, the |
131 * <p>If a system identifier is present, and it is a relative URL, the |
132 * parser will have resolved it fully before passing it through this |
132 * parser will have resolved it fully before passing it through this |
133 * method to a listener.</p> |
133 * method to a listener.</p> |
134 * |
134 * |
135 * @param name The parameter entity name. |
135 * @param name The parameter entity name. |
162 public void endDTD() |
162 public void endDTD() |
163 throws SAXException; |
163 throws SAXException; |
164 |
164 |
165 /** |
165 /** |
166 * Receive notification that a comment has been read. |
166 * Receive notification that a comment has been read. |
167 * <p/> |
167 * <p> |
168 * <P> Note that processing instructions are the mechanism designed |
168 * <P> Note that processing instructions are the mechanism designed |
169 * to hold information for consumption by applications, not comments. |
169 * to hold information for consumption by applications, not comments. |
170 * XML systems may rely on applications being able to access information |
170 * XML systems may rely on applications being able to access information |
171 * found in processing instructions; this is not true of comments, which |
171 * found in processing instructions; this is not true of comments, which |
172 * are typically discarded. |
172 * are typically discarded. |
177 public void comment(String text) |
177 public void comment(String text) |
178 throws SAXException; |
178 throws SAXException; |
179 |
179 |
180 /** |
180 /** |
181 * Receive notification of character data. |
181 * Receive notification of character data. |
182 * <p/> |
182 * <p> |
183 * <p>The Parser will call this method to report each chunk of |
183 * <p>The Parser will call this method to report each chunk of |
184 * character data. SAX parsers may return all contiguous character |
184 * character data. SAX parsers may return all contiguous character |
185 * data in a single chunk, or they may split it into several |
185 * data in a single chunk, or they may split it into several |
186 * chunks; however, all of the characters in any single event |
186 * chunks; however, all of the characters in any single event |
187 * must come from the same external entity, so that the Locator |
187 * must come from the same external entity, so that the Locator |
188 * provides useful information.</p> |
188 * provides useful information.</p> |
189 * <p/> |
189 * <p> |
190 * <p>The application must not attempt to read from the array |
190 * <p>The application must not attempt to read from the array |
191 * outside of the specified range.</p> |
191 * outside of the specified range.</p> |
192 * <p/> |
192 * <p> |
193 * <p>Note that some parsers will report whitespace using the |
193 * <p>Note that some parsers will report whitespace using the |
194 * ignorableWhitespace() method rather than this one (validating |
194 * ignorableWhitespace() method rather than this one (validating |
195 * parsers must do so).</p> |
195 * parsers must do so).</p> |
196 * |
196 * |
197 * @param ch The characters from the DTD. |
197 * @param ch The characters from the DTD. |
204 throws SAXException; |
204 throws SAXException; |
205 |
205 |
206 |
206 |
207 /** |
207 /** |
208 * Receive notification of ignorable whitespace in element content. |
208 * Receive notification of ignorable whitespace in element content. |
209 * <p/> |
209 * <p> |
210 * <p>Validating Parsers must use this method to report each chunk |
210 * <p>Validating Parsers must use this method to report each chunk |
211 * of ignorable whitespace (see the W3C XML 1.0 recommendation, |
211 * of ignorable whitespace (see the W3C XML 1.0 recommendation, |
212 * section 2.10): non-validating parsers may also use this method |
212 * section 2.10): non-validating parsers may also use this method |
213 * if they are capable of parsing and using content models.</p> |
213 * if they are capable of parsing and using content models.</p> |
214 * <p/> |
214 * <p> |
215 * <p>SAX parsers may return all contiguous whitespace in a single |
215 * <p>SAX parsers may return all contiguous whitespace in a single |
216 * chunk, or they may split it into several chunks; however, all of |
216 * chunk, or they may split it into several chunks; however, all of |
217 * the characters in any single event must come from the same |
217 * the characters in any single event must come from the same |
218 * external entity, so that the Locator provides useful |
218 * external entity, so that the Locator provides useful |
219 * information.</p> |
219 * information.</p> |
220 * <p/> |
220 * <p> |
221 * <p>The application must not attempt to read from the array |
221 * <p>The application must not attempt to read from the array |
222 * outside of the specified range.</p> |
222 * outside of the specified range.</p> |
223 * |
223 * |
224 * @param ch The characters from the DTD. |
224 * @param ch The characters from the DTD. |
225 * @param start The start position in the array. |
225 * @param start The start position in the array. |
277 * each child element will be reported by mixedElement method. |
277 * each child element will be reported by mixedElement method. |
278 * {@link #CONTENT_MODEL_CHILDREN} |
278 * {@link #CONTENT_MODEL_CHILDREN} |
279 * this elemen has child content model. The actual content model will |
279 * this elemen has child content model. The actual content model will |
280 * be reported by childElement, startModelGroup, endModelGroup, and |
280 * be reported by childElement, startModelGroup, endModelGroup, and |
281 * connector methods. Possible call sequences are: |
281 * connector methods. Possible call sequences are: |
282 * <p/> |
282 * <p> |
283 * START := MODEL_GROUP |
283 * START := MODEL_GROUP |
284 * MODEL_GROUP := startModelGroup TOKEN (connector TOKEN)* endModelGroup |
284 * MODEL_GROUP := startModelGroup TOKEN (connector TOKEN)* endModelGroup |
285 * TOKEN := childElement |
285 * TOKEN := childElement |
286 * | MODEL_GROUP |
286 * | MODEL_GROUP |
287 */ |
287 */ |
298 public final short USE_REQUIRED = 3; |
298 public final short USE_REQUIRED = 3; |
299 |
299 |
300 /** |
300 /** |
301 * For each entry in an ATTLIST declaration, |
301 * For each entry in an ATTLIST declaration, |
302 * this event will be fired. |
302 * this event will be fired. |
303 * <p/> |
303 * <p> |
304 * <p/> |
304 * <p> |
305 * DTD allows the same attributes to be declared more than |
305 * DTD allows the same attributes to be declared more than |
306 * once, and in that case the first one wins. I think |
306 * once, and in that case the first one wins. I think |
307 * this method will be only fired for the first one, |
307 * this method will be only fired for the first one, |
308 * but I need to check. |
308 * but I need to check. |
309 */ |
309 */ |
327 public final short CHOICE = 0; |
327 public final short CHOICE = 0; |
328 public final short SEQUENCE = 1; |
328 public final short SEQUENCE = 1; |
329 |
329 |
330 /** |
330 /** |
331 * Connectors in one model group is guaranteed to be the same. |
331 * Connectors in one model group is guaranteed to be the same. |
332 * <p/> |
332 * <p> |
333 * <p/> |
333 * <p> |
334 * IOW, you'll never see an event sequence like (a|b,c) |
334 * IOW, you'll never see an event sequence like (a|b,c) |
335 * |
|
336 * @return {@link #CHOICE} or {@link #SEQUENCE}. |
|
337 */ |
335 */ |
338 public void connector(short connectorType) throws SAXException; |
336 public void connector(short connectorType) throws SAXException; |
339 |
337 |
340 public final short OCCURENCE_ZERO_OR_MORE = 0; |
338 public final short OCCURENCE_ZERO_OR_MORE = 0; |
341 public final short OCCURENCE_ONE_OR_MORE = 1; |
339 public final short OCCURENCE_ONE_OR_MORE = 1; |