1/*
2 * reserved comment block
3 * DO NOT REMOVE OR ALTER!
4 */
5/*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements.  See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License.  You may obtain a copy of the License at
12 *
13 *      http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22package com.sun.org.apache.xerces.internal.impl.xs.opti;
23
24import com.sun.org.apache.xerces.internal.xni.QName;
25import com.sun.org.apache.xerces.internal.xni.XMLString;
26import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
27import com.sun.org.apache.xerces.internal.xni.XMLLocator;
28import com.sun.org.apache.xerces.internal.xni.Augmentations;
29import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
30import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
31import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
32import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
33import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
34import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
35import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
36import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
37
38import com.sun.org.apache.xerces.internal.xni.XNIException;
39
40/**
41 * @xerces.internal
42 *
43 * @author Rahul Srivastava, Sun Microsystems Inc.
44 * @author Sandy Gao, IBM
45 *
46 */
47public class DefaultXMLDocumentHandler implements XMLDocumentHandler,
48                                                  XMLDTDHandler,
49                                                  XMLDTDContentModelHandler {
50
51    /** Default Constructor */
52    public DefaultXMLDocumentHandler() {
53    }
54
55    //
56    // XMLDocumentHandler methods
57    //
58
59    /**
60     * The start of the document.
61     *
62     * @param locator  The document locator, or null if the document
63     *                 location cannot be reported during the parsing
64     *                 of this document. However, it is <em>strongly</em>
65     *                 recommended that a locator be supplied that can
66     *                 at least report the system identifier of the
67     *                 document.
68     * @param encoding The auto-detected IANA encoding name of the entity
69     *                 stream. This value will be null in those situations
70     *                 where the entity encoding is not auto-detected (e.g.
71     *                 internal entities or a document entity that is
72     *                 parsed from a java.io.Reader).
73     * @param augs     Additional information that may include infoset augmentations
74     * @exception XNIException
75     *                   Thrown by handler to signal an error.
76     */
77    public void startDocument(XMLLocator locator, String encoding,
78                              NamespaceContext context, Augmentations augs)
79        throws XNIException {
80    }
81
82    /**
83     * Notifies of the presence of an XMLDecl line in the document. If
84     * present, this method will be called immediately following the
85     * startDocument call.
86     *
87     * @param version    The XML version.
88     * @param encoding   The IANA encoding name of the document, or null if
89     *                   not specified.
90     * @param standalone The standalone value, or null if not specified.
91     * @param augs       Additional information that may include infoset augmentations
92     *
93     * @exception XNIException
94     *                   Thrown by handler to signal an error.
95     */
96    public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
97        throws XNIException {
98    }
99
100    /**
101     * Notifies of the presence of the DOCTYPE line in the document.
102     *
103     * @param rootElement
104     *                 The name of the root element.
105     * @param publicId The public identifier if an external DTD or null
106     *                 if the external DTD is specified using SYSTEM.
107     * @param systemId The system identifier if an external DTD, null
108     *                 otherwise.
109     * @param augs     Additional information that may include infoset augmentations
110     *
111     * @exception XNIException
112     *                   Thrown by handler to signal an error.
113     */
114    public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
115        throws XNIException {
116    }
117
118    /**
119     * A comment.
120     *
121     * @param text   The text in the comment.
122     * @param augs   Additional information that may include infoset augmentations
123     *
124     * @exception XNIException
125     *                   Thrown by application to signal an error.
126     */
127    public void comment(XMLString text, Augmentations augs) throws XNIException {
128    }
129
130    /**
131     * A processing instruction. Processing instructions consist of a
132     * target name and, optionally, text data. The data is only meaningful
133     * to the application.
134     * <p>
135     * Typically, a processing instruction's data will contain a series
136     * of pseudo-attributes. These pseudo-attributes follow the form of
137     * element attributes but are <strong>not</strong> parsed or presented
138     * to the application as anything other than text. The application is
139     * responsible for parsing the data.
140     *
141     * @param target The target.
142     * @param data   The data or null if none specified.
143     * @param augs   Additional information that may include infoset augmentations
144     *
145     * @exception XNIException
146     *                   Thrown by handler to signal an error.
147     */
148    public void processingInstruction(String target, XMLString data, Augmentations augs)
149        throws XNIException {
150    }
151
152    /**
153     * The start of a namespace prefix mapping. This method will only be
154     * called when namespace processing is enabled.
155     *
156     * @param prefix The namespace prefix.
157     * @param uri    The URI bound to the prefix.
158     * @param augs   Additional information that may include infoset augmentations
159     *
160     * @exception XNIException
161     *                   Thrown by handler to signal an error.
162     */
163    public void startPrefixMapping(String prefix, String uri, Augmentations augs)
164        throws XNIException {
165    }
166
167    /**
168     * The start of an element.
169     *
170     * @param element    The name of the element.
171     * @param attributes The element attributes.
172     * @param augs       Additional information that may include infoset augmentations
173     *
174     * @exception XNIException
175     *                   Thrown by handler to signal an error.
176     */
177    public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
178        throws XNIException {
179    }
180
181    /**
182     * An empty element.
183     *
184     * @param element    The name of the element.
185     * @param attributes The element attributes.
186     * @param augs       Additional information that may include infoset augmentations
187     *
188     * @exception XNIException
189     *                   Thrown by handler to signal an error.
190     */
191    public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
192        throws XNIException {
193    }
194
195    /**
196     * This method notifies the start of a general entity.
197     * <p>
198     * <strong>Note:</strong> This method is not called for entity references
199     * appearing as part of attribute values.
200     *
201     * @param name     The name of the general entity.
202     * @param identifier The resource identifier.
203     * @param encoding The auto-detected IANA encoding name of the entity
204     *                 stream. This value will be null in those situations
205     *                 where the entity encoding is not auto-detected (e.g.
206     *                 internal entities or a document entity that is
207     *                 parsed from a java.io.Reader).
208     * @param augs     Additional information that may include infoset augmentations
209     *
210     * @exception XNIException Thrown by handler to signal an error.
211     */
212    public void startGeneralEntity(String name,
213                                   XMLResourceIdentifier identifier,
214                                   String encoding,
215                                   Augmentations augs) throws XNIException {
216    }
217
218    /**
219     * Notifies of the presence of a TextDecl line in an entity. If present,
220     * this method will be called immediately following the startEntity call.
221     * <p>
222     * <strong>Note:</strong> This method will never be called for the
223     * document entity; it is only called for external general entities
224     * referenced in document content.
225     * <p>
226     * <strong>Note:</strong> This method is not called for entity references
227     * appearing as part of attribute values.
228     *
229     * @param version  The XML version, or null if not specified.
230     * @param encoding The IANA encoding name of the entity.
231     * @param augs     Additional information that may include infoset augmentations
232     *
233     * @exception XNIException
234     *                   Thrown by handler to signal an error.
235     */
236    public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
237    }
238
239    /**
240     * This method notifies the end of a general entity.
241     * <p>
242     * <strong>Note:</strong> This method is not called for entity references
243     * appearing as part of attribute values.
244     *
245     * @param name   The name of the entity.
246     * @param augs   Additional information that may include infoset augmentations
247     *
248     * @exception XNIException
249     *                   Thrown by handler to signal an error.
250     */
251    public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
252    }
253
254    /**
255     * Character content.
256     *
257     * @param text   The content.
258     * @param augs   Additional information that may include infoset augmentations
259     *
260     * @exception XNIException
261     *                   Thrown by handler to signal an error.
262     */
263    public void characters(XMLString text, Augmentations augs) throws XNIException {
264    }
265
266    /**
267     * Ignorable whitespace. For this method to be called, the document
268     * source must have some way of determining that the text containing
269     * only whitespace characters should be considered ignorable. For
270     * example, the validator can determine if a length of whitespace
271     * characters in the document are ignorable based on the element
272     * content model.
273     *
274     * @param text   The ignorable whitespace.
275     * @param augs   Additional information that may include infoset augmentations
276     *
277     * @exception XNIException
278     *                   Thrown by handler to signal an error.
279     */
280    public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
281    }
282
283    /**
284     * The end of an element.
285     *
286     * @param element The name of the element.
287     * @param augs    Additional information that may include infoset augmentations
288     *
289     * @exception XNIException
290     *                   Thrown by handler to signal an error.
291     */
292    public void endElement(QName element, Augmentations augs) throws XNIException {
293    }
294
295    /**
296     * The end of a namespace prefix mapping. This method will only be
297     * called when namespace processing is enabled.
298     *
299     * @param prefix The namespace prefix.
300     * @param augs   Additional information that may include infoset augmentations
301     *
302     * @exception XNIException
303     *                   Thrown by handler to signal an error.
304     */
305    public void endPrefixMapping(String prefix, Augmentations augs) throws XNIException {
306    }
307
308    /**
309     * The start of a CDATA section.
310     *
311     * @param augs   Additional information that may include infoset augmentations
312     *
313     * @exception XNIException
314     *                   Thrown by handler to signal an error.
315     */
316    public void startCDATA(Augmentations augs) throws XNIException {
317    }
318
319    /**
320     * The end of a CDATA section.
321     *
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 endCDATA(Augmentations augs) throws XNIException {
328    }
329
330    /**
331     * The end of the document.
332     *
333     * @param augs   Additional information that may include infoset augmentations
334     *
335     * @exception XNIException
336     *                   Thrown by handler to signal an error.
337     */
338    public void endDocument(Augmentations augs) throws XNIException {
339    }
340
341
342    //
343    // XMLDTDHandler methods
344    //
345
346    /**
347     * The start of the DTD.
348     *
349     * @param locator  The document locator, or null if the document
350     *                 location cannot be reported during the parsing of
351     *                 the document DTD. However, it is <em>strongly</em>
352     *                 recommended that a locator be supplied that can
353     *                 at least report the base system identifier of the
354     *                 DTD.
355     * @param augmentations Additional information that may include infoset
356     *                      augmentations.
357     *
358     * @throws XNIException Thrown by handler to signal an error.
359     */
360    public void startDTD(XMLLocator locator, Augmentations augmentations)
361        throws XNIException {
362    }
363
364    /**
365     * This method notifies of the start of a parameter entity. The parameter
366     * entity name start with a '%' character.
367     *
368     * @param name     The name of the parameter entity.
369     * @param identifier The resource identifier.
370     * @param encoding The auto-detected IANA encoding name of the entity
371     *                 stream. This value will be null in those situations
372     *                 where the entity encoding is not auto-detected (e.g.
373     *                 internal parameter entities).
374     * @param augmentations Additional information that may include infoset
375     *                      augmentations.
376     *
377     * @throws XNIException Thrown by handler to signal an error.
378     */
379    public void startParameterEntity(String name,
380                                     XMLResourceIdentifier identifier,
381                                     String encoding,
382                                     Augmentations augmentations) throws XNIException {
383    }
384
385    /**
386     * Notifies of the presence of a TextDecl line in an entity. If present,
387     * this method will be called immediately following the startEntity call.
388     * <p>
389     * <strong>Note:</strong> This method is only called for external
390     * parameter entities referenced in the DTD.
391     *
392     * @param version  The XML version, or null if not specified.
393     * @param encoding The IANA encoding name of the entity.
394     * @param augmentations Additional information that may include infoset
395     *                      augmentations.
396     *
397     * @throws XNIException Thrown by handler to signal an error.
398     */
399/*
400    public void textDecl(String version, String encoding,
401                         Augmentations augmentations) throws XNIException {
402    }
403*/
404
405    /**
406     * This method notifies the end of a parameter entity. Parameter entity
407     * names begin with a '%' character.
408     *
409     * @param name The name of the parameter entity.
410     * @param augmentations Additional information that may include infoset
411     *                      augmentations.
412     *
413     * @throws XNIException Thrown by handler to signal an error.
414     */
415    public void endParameterEntity(String name, Augmentations augmentations)
416        throws XNIException {
417    }
418
419    /**
420     * The start of the DTD external subset.
421     *
422     * @param identifier The resource identifier.
423     * @param augmentations
424     *                   Additional information that may include infoset
425     *                   augmentations.
426     * @exception XNIException
427     *                   Thrown by handler to signal an error.
428     */
429    public void startExternalSubset(XMLResourceIdentifier identifier,
430                                    Augmentations augmentations)
431        throws XNIException {
432    }
433
434    /**
435     * The end of the DTD external subset.
436     *
437     * @param augmentations Additional information that may include infoset
438     *                      augmentations.
439     *
440     * @throws XNIException Thrown by handler to signal an error.
441     */
442    public void endExternalSubset(Augmentations augmentations)
443        throws XNIException {
444    }
445
446    /**
447     * A comment.
448     *
449     * @param text The text in the comment.
450     * @param augmentations Additional information that may include infoset
451     *                      augmentations.
452     *
453     * @throws XNIException Thrown by application to signal an error.
454     */
455/*
456    public void comment(XMLString text, Augmentations augmentations)
457        throws XNIException {
458    }
459*/
460
461    /**
462     * A processing instruction. Processing instructions consist of a
463     * target name and, optionally, text data. The data is only meaningful
464     * to the application.
465     * <p>
466     * Typically, a processing instruction's data will contain a series
467     * of pseudo-attributes. These pseudo-attributes follow the form of
468     * element attributes but are <strong>not</strong> parsed or presented
469     * to the application as anything other than text. The application is
470     * responsible for parsing the data.
471     *
472     * @param target The target.
473     * @param data   The data or null if none specified.
474     * @param augmentations Additional information that may include infoset
475     *                      augmentations.
476     *
477     * @throws XNIException Thrown by handler to signal an error.
478     */
479/*
480    public void processingInstruction(String target, XMLString data,
481                                      Augmentations augmentations)
482        throws XNIException {
483    }
484*/
485
486
487    /**
488     * An element declaration.
489     *
490     * @param name         The name of the element.
491     * @param contentModel The element content model.
492     * @param augmentations Additional information that may include infoset
493     *                      augmentations.
494     *
495     * @throws XNIException Thrown by handler to signal an error.
496     */
497    public void elementDecl(String name, String contentModel,
498                            Augmentations augmentations)
499        throws XNIException {
500    }
501
502    /**
503     * The start of an attribute list.
504     *
505     * @param elementName The name of the element that this attribute
506     *                    list is associated with.
507     * @param augmentations Additional information that may include infoset
508     *                      augmentations.
509     *
510     * @throws XNIException Thrown by handler to signal an error.
511     */
512    public void startAttlist(String elementName,
513                             Augmentations augmentations) throws XNIException {
514    }
515
516    /**
517     * An attribute declaration.
518     *
519     * @param elementName   The name of the element that this attribute
520     *                      is associated with.
521     * @param attributeName The name of the attribute.
522     * @param type          The attribute type. This value will be one of
523     *                      the following: "CDATA", "ENTITY", "ENTITIES",
524     *                      "ENUMERATION", "ID", "IDREF", "IDREFS",
525     *                      "NMTOKEN", "NMTOKENS", or "NOTATION".
526     * @param enumeration   If the type has the value "ENUMERATION" or
527     *                      "NOTATION", this array holds the allowed attribute
528     *                      values; otherwise, this array is null.
529     * @param defaultType   The attribute default type. This value will be
530     *                      one of the following: "#FIXED", "#IMPLIED",
531     *                      "#REQUIRED", or null.
532     * @param defaultValue  The attribute default value, or null if no
533     *                      default value is specified.
534     * @param nonNormalizedDefaultValue  The attribute default value with no normalization
535     *                      performed, or null if no default value is specified.
536     * @param augmentations Additional information that may include infoset
537     *                      augmentations.
538     *
539     * @throws XNIException Thrown by handler to signal an error.
540     */
541    public void attributeDecl(String elementName, String attributeName,
542                              String type, String[] enumeration,
543                              String defaultType, XMLString defaultValue,
544                              XMLString nonNormalizedDefaultValue, Augmentations augmentations)
545        throws XNIException {
546    }
547
548    /**
549     * The end of an attribute list.
550     *
551     * @param augmentations Additional information that may include infoset
552     *                      augmentations.
553     *
554     * @throws XNIException Thrown by handler to signal an error.
555     */
556    public void endAttlist(Augmentations augmentations) throws XNIException {
557    }
558
559    /**
560     * An internal entity declaration.
561     *
562     * @param name The name of the entity. Parameter entity names start with
563     *             '%', whereas the name of a general entity is just the
564     *             entity name.
565     * @param text The value of the entity.
566     * @param nonNormalizedText The non-normalized value of the entity. This
567     *             value contains the same sequence of characters that was in
568     *             the internal entity declaration, without any entity
569     *             references expanded.
570     * @param augmentations Additional information that may include infoset
571     *                      augmentations.
572     *
573     * @throws XNIException Thrown by handler to signal an error.
574     */
575    public void internalEntityDecl(String name, XMLString text,
576                                   XMLString nonNormalizedText,
577                                   Augmentations augmentations)
578        throws XNIException {
579    }
580
581    /**
582     * An external entity declaration.
583     *
584     * @param name     The name of the entity. Parameter entity names start
585     *                 with '%', whereas the name of a general entity is just
586     *                 the entity name.
587     * @param identifier    An object containing all location information
588     *                      pertinent to this external entity.
589     * @param augmentations Additional information that may include infoset
590     *                      augmentations.
591     *
592     * @throws XNIException Thrown by handler to signal an error.
593     */
594    public void externalEntityDecl(String name,
595                                   XMLResourceIdentifier identifier,
596                                   Augmentations augmentations)
597        throws XNIException {
598    }
599
600    /**
601     * An unparsed entity declaration.
602     *
603     * @param name     The name of the entity.
604     * @param identifier    An object containing all location information
605     *                      pertinent to this unparsed entity declaration.
606     * @param notation The name of the notation.
607     * @param augmentations Additional information that may include infoset
608     *                      augmentations.
609     *
610     * @throws XNIException Thrown by handler to signal an error.
611     */
612    public void unparsedEntityDecl(String name,
613                                   XMLResourceIdentifier identifier,
614                                   String notation, Augmentations augmentations)
615        throws XNIException {
616    }
617
618    /**
619     * A notation declaration
620     *
621     * @param name     The name of the notation.
622     * @param identifier    An object containing all location information
623     *                      pertinent to this notation.
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 notationDecl(String name, XMLResourceIdentifier identifier,
630                             Augmentations augmentations) throws XNIException {
631    }
632
633    /**
634     * The start of a conditional section.
635     *
636     * @param type The type of the conditional section. This value will
637     *             either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
638     * @param augmentations Additional information that may include infoset
639     *                      augmentations.
640     *
641     * @throws XNIException Thrown by handler to signal an error.
642     *
643     * @see #CONDITIONAL_INCLUDE
644     * @see #CONDITIONAL_IGNORE
645     */
646    public void startConditional(short type, Augmentations augmentations)
647        throws XNIException {
648    }
649
650    /**
651     * Characters within an IGNORE conditional section.
652     *
653     * @param text The ignored text.
654     * @param augmentations Additional information that may include infoset
655     *                      augmentations.
656     *
657     * @throws XNIException Thrown by handler to signal an error.
658     */
659    public void ignoredCharacters(XMLString text, Augmentations augmentations)
660        throws XNIException {
661    }
662
663    /**
664     * The end of a conditional section.
665     *
666     * @param augmentations Additional information that may include infoset
667     *                      augmentations.
668     *
669     * @throws XNIException Thrown by handler to signal an error.
670     */
671    public void endConditional(Augmentations augmentations) throws XNIException {
672    }
673
674    /**
675     * The end of the DTD.
676     *
677     * @param augmentations Additional information that may include infoset
678     *                      augmentations.
679     *
680     * @throws XNIException Thrown by handler to signal an error.
681     */
682    public void endDTD(Augmentations augmentations) throws XNIException {
683    }
684
685
686    //
687    // XMLDTDContentModelHandler methods
688    //
689
690    /**
691     * The start of a content model. Depending on the type of the content
692     * model, specific methods may be called between the call to the
693     * startContentModel method and the call to the endContentModel method.
694     *
695     * @param elementName The name of the element.
696     * @param augmentations Additional information that may include infoset
697     *                      augmentations.
698     *
699     * @throws XNIException Thrown by handler to signal an error.
700     */
701    public void startContentModel(String elementName, Augmentations augmentations)
702        throws XNIException {
703    }
704
705    /**
706     * A content model of ANY.
707     *
708     * @param augmentations Additional information that may include infoset
709     *                      augmentations.
710     *
711     * @throws XNIException Thrown by handler to signal an error.
712     *
713     * @see #empty
714     * @see #startGroup
715     */
716    public void any(Augmentations augmentations) throws XNIException {
717    }
718
719    /**
720     * A content model of EMPTY.
721     *
722     * @throws XNIException Thrown by handler to signal an error.
723     *
724     * @param augmentations Additional information that may include infoset
725     *                      augmentations.
726     *
727     * @see #any
728     * @see #startGroup
729     */
730    public void empty(Augmentations augmentations) throws XNIException {
731    }
732
733    /**
734     * A start of either a mixed or children content model. A mixed
735     * content model will immediately be followed by a call to the
736     * <code>pcdata()</code> method. A children content model will
737     * contain additional groups and/or elements.
738     *
739     * @param augmentations Additional information that may include infoset
740     *                      augmentations.
741     *
742     * @throws XNIException Thrown by handler to signal an error.
743     *
744     * @see #any
745     * @see #empty
746     */
747    public void startGroup(Augmentations augmentations) throws XNIException {
748    }
749
750    /**
751     * The appearance of "#PCDATA" within a group signifying a
752     * mixed content model. This method will be the first called
753     * following the content model's <code>startGroup()</code>.
754     *
755     * @param augmentations Additional information that may include infoset
756     *                      augmentations.
757     *
758     * @throws XNIException Thrown by handler to signal an error.
759     *
760     * @see #startGroup
761     */
762    public void pcdata(Augmentations augmentations) throws XNIException {
763    }
764
765    /**
766     * A referenced element in a mixed or children content model.
767     *
768     * @param elementName The name of the referenced element.
769     * @param augmentations Additional information that may include infoset
770     *                      augmentations.
771     *
772     * @throws XNIException Thrown by handler to signal an error.
773     */
774    public void element(String elementName, Augmentations augmentations)
775        throws XNIException {
776    }
777
778    /**
779     * The separator between choices or sequences of a mixed or children
780     * content model.
781     *
782     * @param separator The type of children separator.
783     * @param augmentations Additional information that may include infoset
784     *                      augmentations.
785     *
786     * @throws XNIException Thrown by handler to signal an error.
787     *
788     * @see #SEPARATOR_CHOICE
789     * @see #SEPARATOR_SEQUENCE
790     */
791    public void separator(short separator, Augmentations augmentations)
792        throws XNIException {
793    }
794
795    /**
796     * The occurrence count for a child in a children content model or
797     * for the mixed content model group.
798     *
799     * @param occurrence The occurrence count for the last element
800     *                   or group.
801     * @param augmentations Additional information that may include infoset
802     *                      augmentations.
803     *
804     * @throws XNIException Thrown by handler to signal an error.
805     *
806     * @see #OCCURS_ZERO_OR_ONE
807     * @see #OCCURS_ZERO_OR_MORE
808     * @see #OCCURS_ONE_OR_MORE
809     */
810    public void occurrence(short occurrence, Augmentations augmentations)
811        throws XNIException {
812    }
813
814    /**
815     * The end of a group for mixed or children content models.
816     *
817     * @param augmentations Additional information that may include infoset
818     *                      augmentations.
819     *
820     * @throws XNIException Thrown by handler to signal an error.
821     */
822    public void endGroup(Augmentations augmentations) throws XNIException {
823    }
824
825    /**
826     * The end of a content model.
827     *
828     * @param augmentations Additional information that may include infoset
829     *                      augmentations.
830     *
831     * @throws XNIException Thrown by handler to signal an error.
832     */
833    public void endContentModel(Augmentations augmentations) throws XNIException {
834    }
835
836    private XMLDocumentSource fDocumentSource;
837
838    /** Sets the document source. */
839    public void setDocumentSource(XMLDocumentSource source) {
840        fDocumentSource = source;
841    }
842
843    /** Returns the document source. */
844    public XMLDocumentSource getDocumentSource() {
845        return fDocumentSource;
846    }
847
848    private XMLDTDSource fDTDSource;
849
850    // set the source of this handler
851    public void setDTDSource(XMLDTDSource source) {
852        fDTDSource = source;
853    }
854
855    // return the source from which this handler derives its events
856    public XMLDTDSource getDTDSource() {
857        return fDTDSource;
858    }
859
860    private XMLDTDContentModelSource fCMSource;
861
862    // set content model source
863    public void setDTDContentModelSource(XMLDTDContentModelSource source) {
864        fCMSource = source;
865    }
866
867    // get content model source
868    public XMLDTDContentModelSource getDTDContentModelSource() {
869        return fCMSource;
870    }
871
872}
873