KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > impl > xs > opti > DefaultXMLDocumentHandler


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

57
58 package com.sun.org.apache.xerces.internal.impl.xs.opti;
59
60 import com.sun.org.apache.xerces.internal.xni.QName;
61 import com.sun.org.apache.xerces.internal.xni.XMLString;
62 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
63 import com.sun.org.apache.xerces.internal.xni.XMLLocator;
64 import com.sun.org.apache.xerces.internal.xni.Augmentations;
65 import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
66 import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
67 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
68 import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
69 import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
70 import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
71 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
72 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
73
74 import com.sun.org.apache.xerces.internal.xni.XNIException;
75
76 /**
77  * @author Rahul Srivastava, Sun Microsystems Inc.
78  * @author Sandy Gao, IBM
79  *
80  * @version $Id: DefaultXMLDocumentHandler.java,v 1.2 2002/12/13 17:23:24 sandygao Exp $
81  */

82 public class DefaultXMLDocumentHandler implements XMLDocumentHandler,
83                                                   XMLDTDHandler,
84                                                   XMLDTDContentModelHandler {
85     
86     /** Default Constructor */
87     public DefaultXMLDocumentHandler() {
88     }
89
90     //
91
// XMLDocumentHandler methods
92
//
93

94     /**
95      * The start of the document.
96      *
97      * @param locator The document locator, or null if the document
98      * location cannot be reported during the parsing
99      * of this document. However, it is <em>strongly</em>
100      * recommended that a locator be supplied that can
101      * at least report the system identifier of the
102      * document.
103      * @param encoding The auto-detected IANA encoding name of the entity
104      * stream. This value will be null in those situations
105      * where the entity encoding is not auto-detected (e.g.
106      * internal entities or a document entity that is
107      * parsed from a java.io.Reader).
108      * @param augs Additional information that may include infoset augmentations
109      * @exception XNIException
110      * Thrown by handler to signal an error.
111      */

112     public void startDocument(XMLLocator locator, String JavaDoc encoding,
113                               NamespaceContext context, Augmentations augs)
114         throws XNIException {
115     }
116
117     /**
118      * Notifies of the presence of an XMLDecl line in the document. If
119      * present, this method will be called immediately following the
120      * startDocument call.
121      *
122      * @param version The XML version.
123      * @param encoding The IANA encoding name of the document, or null if
124      * not specified.
125      * @param standalone The standalone value, or null if not specified.
126      * @param augs Additional information that may include infoset augmentations
127      *
128      * @exception XNIException
129      * Thrown by handler to signal an error.
130      */

131     public void xmlDecl(String JavaDoc version, String JavaDoc encoding, String JavaDoc standalone, Augmentations augs)
132         throws XNIException {
133     }
134
135     /**
136      * Notifies of the presence of the DOCTYPE line in the document.
137      *
138      * @param rootElement
139      * The name of the root element.
140      * @param publicId The public identifier if an external DTD or null
141      * if the external DTD is specified using SYSTEM.
142      * @param systemId The system identifier if an external DTD, null
143      * otherwise.
144      * @param augs Additional information that may include infoset augmentations
145      *
146      * @exception XNIException
147      * Thrown by handler to signal an error.
148      */

149     public void doctypeDecl(String JavaDoc rootElement, String JavaDoc publicId, String JavaDoc systemId, Augmentations augs)
150         throws XNIException {
151     }
152
153     /**
154      * A comment.
155      *
156      * @param text The text in the comment.
157      * @param augs Additional information that may include infoset augmentations
158      *
159      * @exception XNIException
160      * Thrown by application to signal an error.
161      */

162     public void comment(XMLString text, Augmentations augs) throws XNIException {
163     }
164
165     /**
166      * A processing instruction. Processing instructions consist of a
167      * target name and, optionally, text data. The data is only meaningful
168      * to the application.
169      * <p>
170      * Typically, a processing instruction's data will contain a series
171      * of pseudo-attributes. These pseudo-attributes follow the form of
172      * element attributes but are <strong>not</strong> parsed or presented
173      * to the application as anything other than text. The application is
174      * responsible for parsing the data.
175      *
176      * @param target The target.
177      * @param data The data or null if none specified.
178      * @param augs Additional information that may include infoset augmentations
179      *
180      * @exception XNIException
181      * Thrown by handler to signal an error.
182      */

183     public void processingInstruction(String JavaDoc target, XMLString data, Augmentations augs)
184         throws XNIException {
185     }
186
187     /**
188      * The start of a namespace prefix mapping. This method will only be
189      * called when namespace processing is enabled.
190      *
191      * @param prefix The namespace prefix.
192      * @param uri The URI bound to the prefix.
193      * @param augs Additional information that may include infoset augmentations
194      *
195      * @exception XNIException
196      * Thrown by handler to signal an error.
197      */

198     public void startPrefixMapping(String JavaDoc prefix, String JavaDoc uri, Augmentations augs)
199         throws XNIException {
200     }
201
202     /**
203      * The start of an element.
204      *
205      * @param element The name of the element.
206      * @param attributes The element attributes.
207      * @param augs Additional information that may include infoset augmentations
208      *
209      * @exception XNIException
210      * Thrown by handler to signal an error.
211      */

212     public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
213         throws XNIException {
214     }
215
216     /**
217      * An empty element.
218      *
219      * @param element The name of the element.
220      * @param attributes The element attributes.
221      * @param augs Additional information that may include infoset augmentations
222      *
223      * @exception XNIException
224      * Thrown by handler to signal an error.
225      */

226     public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
227         throws XNIException {
228     }
229
230     /**
231      * This method notifies the start of a general entity.
232      * <p>
233      * <strong>Note:</strong> This method is not called for entity references
234      * appearing as part of attribute values.
235      *
236      * @param name The name of the general entity.
237      * @param identifier The resource identifier.
238      * @param encoding The auto-detected IANA encoding name of the entity
239      * stream. This value will be null in those situations
240      * where the entity encoding is not auto-detected (e.g.
241      * internal entities or a document entity that is
242      * parsed from a java.io.Reader).
243      * @param augs Additional information that may include infoset augmentations
244      *
245      * @exception XNIException Thrown by handler to signal an error.
246      */

247     public void startGeneralEntity(String JavaDoc name,
248                                    XMLResourceIdentifier identifier,
249                                    String JavaDoc encoding,
250                                    Augmentations augs) throws XNIException {
251     }
252
253     /**
254      * Notifies of the presence of a TextDecl line in an entity. If present,
255      * this method will be called immediately following the startEntity call.
256      * <p>
257      * <strong>Note:</strong> This method will never be called for the
258      * document entity; it is only called for external general entities
259      * referenced in document content.
260      * <p>
261      * <strong>Note:</strong> This method is not called for entity references
262      * appearing as part of attribute values.
263      *
264      * @param version The XML version, or null if not specified.
265      * @param encoding The IANA encoding name of the entity.
266      * @param augs Additional information that may include infoset augmentations
267      *
268      * @exception XNIException
269      * Thrown by handler to signal an error.
270      */

271     public void textDecl(String JavaDoc version, String JavaDoc encoding, Augmentations augs) throws XNIException {
272     }
273
274     /**
275      * This method notifies the end of a general entity.
276      * <p>
277      * <strong>Note:</strong> This method is not called for entity references
278      * appearing as part of attribute values.
279      *
280      * @param name The name of the entity.
281      * @param augs Additional information that may include infoset augmentations
282      *
283      * @exception XNIException
284      * Thrown by handler to signal an error.
285      */

286     public void endGeneralEntity(String JavaDoc name, Augmentations augs) throws XNIException {
287     }
288
289     /**
290      * Character content.
291      *
292      * @param text The content.
293      * @param augs Additional information that may include infoset augmentations
294      *
295      * @exception XNIException
296      * Thrown by handler to signal an error.
297      */

298     public void characters(XMLString text, Augmentations augs) throws XNIException {
299     }
300
301     /**
302      * Ignorable whitespace. For this method to be called, the document
303      * source must have some way of determining that the text containing
304      * only whitespace characters should be considered ignorable. For
305      * example, the validator can determine if a length of whitespace
306      * characters in the document are ignorable based on the element
307      * content model.
308      *
309      * @param text The ignorable whitespace.
310      * @param augs Additional information that may include infoset augmentations
311      *
312      * @exception XNIException
313      * Thrown by handler to signal an error.
314      */

315     public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
316     }
317
318     /**
319      * The end of an element.
320      *
321      * @param element The name of the element.
322      * @param augs Additional information that may include infoset augmentations
323      *
324      * @exception XNIException
325      * Thrown by handler to signal an error.
326      */

327     public void endElement(QName element, Augmentations augs) throws XNIException {
328     }
329
330     /**
331      * The end of a namespace prefix mapping. This method will only be
332      * called when namespace processing is enabled.
333      *
334      * @param prefix The namespace prefix.
335      * @param augs Additional information that may include infoset augmentations
336      *
337      * @exception XNIException
338      * Thrown by handler to signal an error.
339      */

340     public void endPrefixMapping(String JavaDoc prefix, Augmentations augs) throws XNIException {
341     }
342
343     /**
344      * The start of a CDATA section.
345      *
346      * @param augs Additional information that may include infoset augmentations
347      *
348      * @exception XNIException
349      * Thrown by handler to signal an error.
350      */

351     public void startCDATA(Augmentations augs) throws XNIException {
352     }
353
354     /**
355      * The end of a CDATA section.
356      *
357      * @param augs Additional information that may include infoset augmentations
358      *
359      * @exception XNIException
360      * Thrown by handler to signal an error.
361      */

362     public void endCDATA(Augmentations augs) throws XNIException {
363     }
364
365     /**
366      * The end of the document.
367      *
368      * @param augs Additional information that may include infoset augmentations
369      *
370      * @exception XNIException
371      * Thrown by handler to signal an error.
372      */

373     public void endDocument(Augmentations augs) throws XNIException {
374     }
375
376
377     //
378
// XMLDTDHandler methods
379
//
380

381     /**
382      * The start of the DTD.
383      *
384      * @param locator The document locator, or null if the document
385      * location cannot be reported during the parsing of
386      * the document DTD. However, it is <em>strongly</em>
387      * recommended that a locator be supplied that can
388      * at least report the base system identifier of the
389      * DTD.
390      * @param augmentations Additional information that may include infoset
391      * augmentations.
392      *
393      * @throws XNIException Thrown by handler to signal an error.
394      */

395     public void startDTD(XMLLocator locator, Augmentations augmentations)
396         throws XNIException {
397     }
398
399     /**
400      * This method notifies of the start of a parameter entity. The parameter
401      * entity name start with a '%' character.
402      *
403      * @param name The name of the parameter entity.
404      * @param identifier The resource identifier.
405      * @param encoding The auto-detected IANA encoding name of the entity
406      * stream. This value will be null in those situations
407      * where the entity encoding is not auto-detected (e.g.
408      * internal parameter entities).
409      * @param augmentations Additional information that may include infoset
410      * augmentations.
411      *
412      * @throws XNIException Thrown by handler to signal an error.
413      */

414     public void startParameterEntity(String JavaDoc name,
415                                      XMLResourceIdentifier identifier,
416                                      String JavaDoc encoding,
417                                      Augmentations augmentations) throws XNIException {
418     }
419
420     /**
421      * Notifies of the presence of a TextDecl line in an entity. If present,
422      * this method will be called immediately following the startEntity call.
423      * <p>
424      * <strong>Note:</strong> This method is only called for external
425      * parameter entities referenced in the DTD.
426      *
427      * @param version The XML version, or null if not specified.
428      * @param encoding The IANA encoding name of the entity.
429      * @param augmentations Additional information that may include infoset
430      * augmentations.
431      *
432      * @throws XNIException Thrown by handler to signal an error.
433      */

434 /*
435     public void textDecl(String version, String encoding,
436                          Augmentations augmentations) throws XNIException {
437     }
438 */

439
440     /**
441      * This method notifies the end of a parameter entity. Parameter entity
442      * names begin with a '%' character.
443      *
444      * @param name The name of the parameter entity.
445      * @param augmentations Additional information that may include infoset
446      * augmentations.
447      *
448      * @throws XNIException Thrown by handler to signal an error.
449      */

450     public void endParameterEntity(String JavaDoc name, Augmentations augmentations)
451         throws XNIException {
452     }
453
454     /**
455      * The start of the DTD external subset.
456      *
457      * @param identifier The resource identifier.
458      * @param augmentations
459      * Additional information that may include infoset
460      * augmentations.
461      * @exception XNIException
462      * Thrown by handler to signal an error.
463      */

464     public void startExternalSubset(XMLResourceIdentifier ri,
465                                     Augmentations augmentations)
466         throws XNIException {
467     }
468
469     /**
470      * The end of the DTD external subset.
471      *
472      * @param augmentations Additional information that may include infoset
473      * augmentations.
474      *
475      * @throws XNIException Thrown by handler to signal an error.
476      */

477     public void endExternalSubset(Augmentations augmentations)
478         throws XNIException {
479     }
480
481     /**
482      * A comment.
483      *
484      * @param text The text in the comment.
485      * @param augmentations Additional information that may include infoset
486      * augmentations.
487      *
488      * @throws XNIException Thrown by application to signal an error.
489      */

490 /*
491     public void comment(XMLString text, Augmentations augmentations)
492         throws XNIException {
493     }
494 */

495
496     /**
497      * A processing instruction. Processing instructions consist of a
498      * target name and, optionally, text data. The data is only meaningful
499      * to the application.
500      * <p>
501      * Typically, a processing instruction's data will contain a series
502      * of pseudo-attributes. These pseudo-attributes follow the form of
503      * element attributes but are <strong>not</strong> parsed or presented
504      * to the application as anything other than text. The application is
505      * responsible for parsing the data.
506      *
507      * @param target The target.
508      * @param data The data or null if none specified.
509      * @param augmentations Additional information that may include infoset
510      * augmentations.
511      *
512      * @throws XNIException Thrown by handler to signal an error.
513      */

514 /*
515     public void processingInstruction(String target, XMLString data,
516                                       Augmentations augmentations)
517         throws XNIException {
518     }
519 */

520
521
522     /**
523      * An element declaration.
524      *
525      * @param name The name of the element.
526      * @param contentModel The element content model.
527      * @param augmentations Additional information that may include infoset
528      * augmentations.
529      *
530      * @throws XNIException Thrown by handler to signal an error.
531      */

532     public void elementDecl(String JavaDoc name, String JavaDoc contentModel,
533                             Augmentations augmentations)
534         throws XNIException {
535     }
536
537     /**
538      * The start of an attribute list.
539      *
540      * @param elementName The name of the element that this attribute
541      * list is associated with.
542      * @param augmentations Additional information that may include infoset
543      * augmentations.
544      *
545      * @throws XNIException Thrown by handler to signal an error.
546      */

547     public void startAttlist(String JavaDoc elementName,
548                              Augmentations augmentations) throws XNIException {
549     }
550
551     /**
552      * An attribute declaration.
553      *
554      * @param elementName The name of the element that this attribute
555      * is associated with.
556      * @param attributeName The name of the attribute.
557      * @param type The attribute type. This value will be one of
558      * the following: "CDATA", "ENTITY", "ENTITIES",
559      * "ENUMERATION", "ID", "IDREF", "IDREFS",
560      * "NMTOKEN", "NMTOKENS", or "NOTATION".
561      * @param enumeration If the type has the value "ENUMERATION" or
562      * "NOTATION", this array holds the allowed attribute
563      * values; otherwise, this array is null.
564      * @param defaultType The attribute default type. This value will be
565      * one of the following: "#FIXED", "#IMPLIED",
566      * "#REQUIRED", or null.
567      * @param defaultValue The attribute default value, or null if no
568      * default value is specified.
569      * @param nonNormalizedDefaultValue The attribute default value with no normalization
570      * performed, or null if no default value is specified.
571      * @param augmentations Additional information that may include infoset
572      * augmentations.
573      *
574      * @throws XNIException Thrown by handler to signal an error.
575      */

576     public void attributeDecl(String JavaDoc elementName, String JavaDoc attributeName,
577                               String JavaDoc type, String JavaDoc[] enumeration,
578                               String JavaDoc defaultType, XMLString defaultValue,
579                               XMLString nonNormalizedDefaultValue, Augmentations augmentations)
580         throws XNIException {
581     }
582
583     /**
584      * The end of an attribute list.
585      *
586      * @param augmentations Additional information that may include infoset
587      * augmentations.
588      *
589      * @throws XNIException Thrown by handler to signal an error.
590      */

591     public void endAttlist(Augmentations augmentations) throws XNIException {
592     }
593
594     /**
595      * An internal entity declaration.
596      *
597      * @param name The name of the entity. Parameter entity names start with
598      * '%', whereas the name of a general entity is just the
599      * entity name.
600      * @param text The value of the entity.
601      * @param nonNormalizedText The non-normalized value of the entity. This
602      * value contains the same sequence of characters that was in
603      * the internal entity declaration, without any entity
604      * references expanded.
605      * @param augmentations Additional information that may include infoset
606      * augmentations.
607      *
608      * @throws XNIException Thrown by handler to signal an error.
609      */

610     public void internalEntityDecl(String JavaDoc name, XMLString text,
611                                    XMLString nonNormalizedText,
612                                    Augmentations augmentations)
613         throws XNIException {
614     }
615
616     /**
617      * An external entity declaration.
618      *
619      * @param name The name of the entity. Parameter entity names start
620      * with '%', whereas the name of a general entity is just
621      * the entity name.
622      * @param identifier An object containing all location information
623      * pertinent to this external entity.
624      * @param augmentations Additional information that may include infoset
625      * augmentations.
626      *
627      * @throws XNIException Thrown by handler to signal an error.
628      */

629     public void externalEntityDecl(String JavaDoc name,
630                                    XMLResourceIdentifier identifier,
631                                    Augmentations augmentations)
632         throws XNIException {
633     }
634
635     /**
636      * An unparsed entity declaration.
637      *
638      * @param name The name of the entity.
639      * @param identifier An object containing all location information
640      * pertinent to this unparsed entity declaration.
641      * @param notation The name of the notation.
642      * @param augmentations Additional information that may include infoset
643      * augmentations.
644      *
645      * @throws XNIException Thrown by handler to signal an error.
646      */

647     public void unparsedEntityDecl(String JavaDoc name,
648                                    XMLResourceIdentifier identifier,
649                                    String JavaDoc notation, Augmentations augmentations)
650         throws XNIException {
651     }
652
653     /**
654      * A notation declaration
655      *
656      * @param name The name of the notation.
657      * @param identifier An object containing all location information
658      * pertinent to this notation.
659      * @param augmentations Additional information that may include infoset
660      * augmentations.
661      *
662      * @throws XNIException Thrown by handler to signal an error.
663      */

664     public void notationDecl(String JavaDoc name, XMLResourceIdentifier identifier,
665                              Augmentations augmentations) throws XNIException {
666     }
667
668     /**
669      * The start of a conditional section.
670      *
671      * @param type The type of the conditional section. This value will
672      * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
673      * @param augmentations Additional information that may include infoset
674      * augmentations.
675      *
676      * @throws XNIException Thrown by handler to signal an error.
677      *
678      * @see #CONDITIONAL_INCLUDE
679      * @see #CONDITIONAL_IGNORE
680      */

681     public void startConditional(short type, Augmentations augmentations)
682         throws XNIException {
683     }
684
685     /**
686      * Characters within an IGNORE conditional section.
687      *
688      * @param text The ignored text.
689      * @param augmentations Additional information that may include infoset
690      * augmentations.
691      *
692      * @throws XNIException Thrown by handler to signal an error.
693      */

694     public void ignoredCharacters(XMLString text, Augmentations augmentations)
695         throws XNIException {
696     }
697
698     /**
699      * The end of a conditional section.
700      *
701      * @param augmentations Additional information that may include infoset
702      * augmentations.
703      *
704      * @throws XNIException Thrown by handler to signal an error.
705      */

706     public void endConditional(Augmentations augmentations) throws XNIException {
707     }
708
709     /**
710      * The end of the DTD.
711      *
712      * @param augmentations Additional information that may include infoset
713      * augmentations.
714      *
715      * @throws XNIException Thrown by handler to signal an error.
716      */

717     public void endDTD(Augmentations augmentations) throws XNIException {
718     }
719
720
721     //
722
// XMLDTDContentModelHandler methods
723
//
724

725     /**
726      * The start of a content model. Depending on the type of the content
727      * model, specific methods may be called between the call to the
728      * startContentModel method and the call to the endContentModel method.
729      *
730      * @param elementName The name of the element.
731      * @param augmentations Additional information that may include infoset
732      * augmentations.
733      *
734      * @throws XNIException Thrown by handler to signal an error.
735      */

736     public void startContentModel(String JavaDoc elementName, Augmentations augmentations)
737         throws XNIException {
738     }
739
740     /**
741      * A content model of ANY.
742      *
743      * @param augmentations Additional information that may include infoset
744      * augmentations.
745      *
746      * @throws XNIException Thrown by handler to signal an error.
747      *
748      * @see #empty
749      * @see #startGroup
750      */

751     public void any(Augmentations augmentations) throws XNIException {
752     }
753
754     /**
755      * A content model of EMPTY.
756      *
757      * @throws XNIException Thrown by handler to signal an error.
758      *
759      * @param augmentations Additional information that may include infoset
760      * augmentations.
761      *
762      * @see #any
763      * @see #startGroup
764      */

765     public void empty(Augmentations augmentations) throws XNIException {
766     }
767
768     /**
769      * A start of either a mixed or children content model. A mixed
770      * content model will immediately be followed by a call to the
771      * <code>pcdata()</code> method. A children content model will
772      * contain additional groups and/or elements.
773      *
774      * @param augmentations Additional information that may include infoset
775      * augmentations.
776      *
777      * @throws XNIException Thrown by handler to signal an error.
778      *
779      * @see #any
780      * @see #empty
781      */

782     public void startGroup(Augmentations augmentations) throws XNIException {
783     }
784
785     /**
786      * The appearance of "#PCDATA" within a group signifying a
787      * mixed content model. This method will be the first called
788      * following the content model's <code>startGroup()</code>.
789      *
790      * @param augmentations Additional information that may include infoset
791      * augmentations.
792      *
793      * @throws XNIException Thrown by handler to signal an error.
794      *
795      * @see #startGroup
796      */

797     public void pcdata(Augmentations augmentations) throws XNIException {
798     }
799
800     /**
801      * A referenced element in a mixed or children content model.
802      *
803      * @param elementName The name of the referenced element.
804      * @param augmentations Additional information that may include infoset
805      * augmentations.
806      *
807      * @throws XNIException Thrown by handler to signal an error.
808      */

809     public void element(String JavaDoc elementName, Augmentations augmentations)
810         throws XNIException {
811     }
812
813     /**
814      * The separator between choices or sequences of a mixed or children
815      * content model.
816      *
817      * @param separator The type of children separator.
818      * @param augmentations Additional information that may include infoset
819      * augmentations.
820      *
821      * @throws XNIException Thrown by handler to signal an error.
822      *
823      * @see #SEPARATOR_CHOICE
824      * @see #SEPARATOR_SEQUENCE
825      */

826     public void separator(short separator, Augmentations augmentations)
827         throws XNIException {
828     }
829
830     /**
831      * The occurrence count for a child in a children content model or
832      * for the mixed content model group.
833      *
834      * @param occurrence The occurrence count for the last element
835      * or group.
836      * @param augmentations Additional information that may include infoset
837      * augmentations.
838      *
839      * @throws XNIException Thrown by handler to signal an error.
840      *
841      * @see #OCCURS_ZERO_OR_ONE
842      * @see #OCCURS_ZERO_OR_MORE
843      * @see #OCCURS_ONE_OR_MORE
844      */

845     public void occurrence(short occurrence, Augmentations augmentations)
846         throws XNIException {
847     }
848
849     /**
850      * The end of a group for mixed or children content models.
851      *
852      * @param augmentations Additional information that may include infoset
853      * augmentations.
854      *
855      * @throws XNIException Thrown by handler to signal an error.
856      */

857     public void endGroup(Augmentations augmentations) throws XNIException {
858     }
859
860     /**
861      * The end of a content model.
862      *
863      * @param augmentations Additional information that may include infoset
864      * augmentations.
865      *
866      * @throws XNIException Thrown by handler to signal an error.
867      */

868     public void endContentModel(Augmentations augmentations) throws XNIException {
869     }
870
871     private XMLDocumentSource fDocumentSource;
872
873     /** Sets the document source. */
874     public void setDocumentSource(XMLDocumentSource source) {
875         fDocumentSource = source;
876     }
877
878     /** Returns the document source. */
879     public XMLDocumentSource getDocumentSource() {
880         return fDocumentSource;
881     }
882
883     private XMLDTDSource fDTDSource;
884     
885     // set the source of this handler
886
public void setDTDSource(XMLDTDSource source) {
887         fDTDSource = source;
888     }
889
890     // return the source from which this handler derives its events
891
public XMLDTDSource getDTDSource() {
892         return fDTDSource;
893     }
894
895     private XMLDTDContentModelSource fCMSource;
896
897     // set content model source
898
public void setDTDContentModelSource(XMLDTDContentModelSource source) {
899         fCMSource = source;
900     }
901
902     // get content model source
903
public XMLDTDContentModelSource getDTDContentModelSource() {
904         return fCMSource;
905     }
906     
907 }
908
909
Popular Tags