KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > parsers > AbstractXMLDocumentParser


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  *
5  * Copyright (c) 2001, 2002 The Apache Software Foundation.
6  * All rights 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) 1999, 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.parsers;
59
60 import com.sun.org.apache.xerces.internal.xni.Augmentations;
61 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
62 import com.sun.org.apache.xerces.internal.xni.QName;
63 import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
64 import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
65 import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
66 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
67 import com.sun.org.apache.xerces.internal.xni.XMLLocator;
68 import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
69 import com.sun.org.apache.xerces.internal.xni.XMLString;
70 import com.sun.org.apache.xerces.internal.xni.XNIException;
71 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
72 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
73 import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
74 import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
75
76 /**
77  * This is the base class for all XML document parsers. XMLDocumentParser
78  * provides a common implementation shared by the various document parsers
79  * in the Xerces package. While this class is provided for convenience, it
80  * does not prevent other kinds of parsers to be constructed using the XNI
81  * interfaces.
82  *
83  * @author Arnaud Le Hors, IBM
84  * @author Andy Clark, IBM
85  *
86  * @version $Id: AbstractXMLDocumentParser.java,v 1.17 2003/05/08 20:11:58 elena Exp $
87  */

88 public abstract class AbstractXMLDocumentParser
89     extends XMLParser
90     implements XMLDocumentHandler, XMLDTDHandler, XMLDTDContentModelHandler {
91
92     //
93
// Data
94
//
95

96     // state
97

98     /** True if inside DTD. */
99     protected boolean fInDTD;
100
101     /** Document source*/
102     protected XMLDocumentSource fDocumentSource;
103
104     /** DTD source*/
105     protected XMLDTDSource fDTDSource;
106
107     /** DTD content model source*/
108     protected XMLDTDContentModelSource fDTDContentModelSource;
109
110     //
111
// Constructors
112
//
113

114     /**
115      * Constructs a document parser using the default symbol table
116      * and grammar pool.
117      */

118     protected AbstractXMLDocumentParser(XMLParserConfiguration config) {
119         super(config);
120
121         // set handlers
122
config.setDocumentHandler(this);
123         config.setDTDHandler(this);
124         config.setDTDContentModelHandler(this);
125
126     } // <init>(XMLParserConfiguration)
127

128     //
129
// XMLDocumentHandler methods
130
//
131

132     /**
133      * The start of the document.
134      *
135      * @param locator The system identifier of the entity if the entity
136      * is external, null otherwise.
137      * @param encoding The auto-detected IANA encoding name of the entity
138      * stream. This value will be null in those situations
139      * where the entity encoding is not auto-detected (e.g.
140      * internal entities or a document entity that is
141      * parsed from a java.io.Reader).
142      * @param namespaceContext
143      * The namespace context in effect at the
144      * start of this document.
145      * This object represents the current context.
146      * Implementors of this class are responsible
147      * for copying the namespace bindings from the
148      * the current context (and its parent contexts)
149      * if that information is important.
150      * @param augs Additional information that may include infoset augmentations
151      *
152      * @throws XNIException Thrown by handler to signal an error.
153      */

154
155     public void startDocument(XMLLocator locator, String JavaDoc encoding,
156                               NamespaceContext namespaceContext, Augmentations augs)
157         throws XNIException {
158     } // startDocument(XMLLocator,String)
159

160     /**
161      * Notifies of the presence of an XMLDecl line in the document. If
162      * present, this method will be called immediately following the
163      * startDocument call.
164      *
165      * @param version The XML version.
166      * @param encoding The IANA encoding name of the document, or null if
167      * not specified.
168      * @param standalone The standalone value, or null if not specified.
169      * @param augs Additional information that may include infoset augmentations
170      *
171      * @throws XNIException Thrown by handler to signal an error.
172      */

173     public void xmlDecl(String JavaDoc version, String JavaDoc encoding, String JavaDoc standalone, Augmentations augs)
174         throws XNIException {
175     } // xmlDecl(String,String,String)
176

177     /**
178      * Notifies of the presence of the DOCTYPE line in the document.
179      *
180      * @param rootElement The name of the root element.
181      * @param publicId The public identifier if an external DTD or null
182      * if the external DTD is specified using SYSTEM.
183      * @param systemId The system identifier if an external DTD, null
184      * @param augs Additional information that may include infoset augmentations
185      * otherwise.
186      *
187      * @throws XNIException Thrown by handler to signal an error.
188      */

189     public void doctypeDecl(String JavaDoc rootElement, String JavaDoc publicId, String JavaDoc systemId, Augmentations augs)
190         throws XNIException {
191     } // doctypeDecl(String,String,String)
192

193     /**
194      * The start of an element. If the document specifies the start element
195      * by using an empty tag, then the startElement method will immediately
196      * be followed by the endElement method, with no intervening methods.
197      *
198      * @param element The name of the element.
199      * @param attributes The element attributes.
200      * @param augs Additional information that may include infoset augmentations
201      *
202      * @throws XNIException Thrown by handler to signal an error.
203      */

204     public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
205         throws XNIException {
206     } // startElement(QName,XMLAttributes)
207

208     /**
209      * An empty element.
210      *
211      * @param element The name of the element.
212      * @param attributes The element attributes.
213      * @param augs Additional information that may include infoset augmentations
214      *
215      * @throws XNIException Thrown by handler to signal an error.
216      */

217     public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
218         throws XNIException {
219
220         startElement(element, attributes, augs);
221         endElement(element, augs);
222
223     } // emptyElement(QName,XMLAttributes)
224

225     /**
226      * Character content.
227      *
228      * @param text The content.
229      * @param augs Additional information that may include infoset augmentations
230      *
231      * @throws XNIException Thrown by handler to signal an error.
232      */

233     public void characters(XMLString text, Augmentations augs) throws XNIException {
234     } // characters(XMLString)
235

236     /**
237      * Ignorable whitespace. For this method to be called, the document
238      * source must have some way of determining that the text containing
239      * only whitespace characters should be considered ignorable. For
240      * example, the validator can determine if a length of whitespace
241      * characters in the document are ignorable based on the element
242      * content model.
243      *
244      * @param text The ignorable whitespace.
245      * @param augs Additional information that may include infoset augmentations
246      *
247      * @throws XNIException Thrown by handler to signal an error.
248      */

249     public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
250     } // ignorableWhitespace(XMLString)
251

252     /**
253      * The end of an element.
254      *
255      * @param element The name of the element.
256      * @param augs Additional information that may include infoset augmentations
257      *
258      * @throws XNIException Thrown by handler to signal an error.
259      */

260     public void endElement(QName element, Augmentations augs) throws XNIException {
261     } // endElement(QName)
262

263     /**
264      * The start of a CDATA section.
265      * @param augs Additional information that may include infoset augmentations
266      *
267      * @throws XNIException Thrown by handler to signal an error.
268      */

269     public void startCDATA(Augmentations augs) throws XNIException {
270     } // startCDATA()
271

272     /**
273      * The end of a CDATA section.
274      * @param augs Additional information that may include infoset augmentations
275      *
276      * @throws XNIException Thrown by handler to signal an error.
277      */

278     public void endCDATA(Augmentations augs) throws XNIException {
279     } // endCDATA()
280

281     /**
282      * The end of the document.
283      * @param augs Additional information that may include infoset augmentations
284      *
285      * @throws XNIException Thrown by handler to signal an error.
286      */

287     public void endDocument(Augmentations augs) throws XNIException {
288     } // endDocument()
289

290
291     /**
292      * This method notifies the start of an entity.
293      * <p>
294      * <strong>Note:</strong> This method is not called for entity references
295      * appearing as part of attribute values.
296      *
297      * @param name The name of the entity.
298      * @param identifier The resource identifier.
299      * @param encoding The auto-detected IANA encoding name of the entity
300      * stream. This value will be null in those situations
301      * where the entity encoding is not auto-detected (e.g.
302      * internal entities or a document entity that is
303      * parsed from a java.io.Reader).
304      * @param augs Additional information that may include infoset augmentations
305      *
306      * @exception XNIException Thrown by handler to signal an error.
307      */

308     public void startGeneralEntity(String JavaDoc name,
309                                    XMLResourceIdentifier identifier,
310                                    String JavaDoc encoding,
311                                    Augmentations augs) throws XNIException {
312     } // startGeneralEntity(String,XMLResourceIdentifier,String,Augmentations)
313

314     /**
315      * Notifies of the presence of a TextDecl line in an entity. If present,
316      * this method will be called immediately following the startEntity call.
317      * <p>
318      * <strong>Note:</strong> This method will never be called for the
319      * document entity; it is only called for external general entities
320      * referenced in document content.
321      * <p>
322      * <strong>Note:</strong> This method is not called for entity references
323      * appearing as part of attribute values.
324      *
325      * @param version The XML version, or null if not specified.
326      * @param encoding The IANA encoding name of the entity.
327      * @param augs Additional information that may include infoset augmentations
328      *
329      * @exception XNIException
330      * Thrown by handler to signal an error.
331      */

332     public void textDecl(String JavaDoc version, String JavaDoc encoding, Augmentations augs) throws XNIException {
333     } // textDecl(String, String, Augmentations)
334

335     /**
336      * This method notifies the end of an entity.
337      * <p>
338      * <strong>Note:</strong> This method is not called for entity references
339      * appearing as part of attribute values.
340      *
341      * @param name The name of the entity.
342      * @param augs Additional information that may include infoset augmentations
343      *
344      * @exception XNIException
345      * Thrown by handler to signal an error.
346      */

347     public void endGeneralEntity(String JavaDoc name, Augmentations augs)
348         throws XNIException {
349     } // endGeneralEntity(String,Augmentations)
350

351     /**
352      * A comment.
353      *
354      * @param text The text in the comment.
355      * @param augs Additional information that may include infoset augmentations
356      *
357      * @exception XNIException
358      * Thrown by application to signal an error.
359      */

360     public void comment(XMLString text, Augmentations augs) throws XNIException {
361     } // comment (XMLString, Augmentations)
362

363     /**
364      * A processing instruction. Processing instructions consist of a
365      * target name and, optionally, text data. The data is only meaningful
366      * to the application.
367      * <p>
368      * Typically, a processing instruction's data will contain a series
369      * of pseudo-attributes. These pseudo-attributes follow the form of
370      * element attributes but are <strong>not</strong> parsed or presented
371      * to the application as anything other than text. The application is
372      * responsible for parsing the data.
373      *
374      * @param target The target.
375      * @param data The data or null if none specified.
376      * @param augs Additional information that may include infoset augmentations
377      *
378      * @exception XNIException
379      * Thrown by handler to signal an error.
380      */

381     public void processingInstruction(String JavaDoc target, XMLString data, Augmentations augs)
382         throws XNIException {
383     } // processingInstruction(String, XMLString, Augmentations)
384

385     
386     /** Sets the document source */
387     public void setDocumentSource(XMLDocumentSource source){
388         fDocumentSource = source;
389     } // setDocumentSource
390

391     /** Returns the document source */
392     public XMLDocumentSource getDocumentSource (){
393         return fDocumentSource;
394     } // getDocumentSource
395
//
396
// XMLDTDHandler methods
397
//
398

399     /**
400      * The start of the DTD.
401      *
402      * @param locator The document locator, or null if the document
403      * location cannot be reported during the parsing of
404      * the document DTD. However, it is <em>strongly</em>
405      * recommended that a locator be supplied that can
406      * at least report the base system identifier of the
407      * DTD.
408      * @param augs Additional information that may include infoset
409      * augmentations.
410      *
411      * @throws XNIException Thrown by handler to signal an error.
412      */

413     public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
414         fInDTD = true;
415     } // startDTD(XMLLocator)
416

417
418     /**
419      * The start of the DTD external subset.
420      *
421      * @param augmentations Additional information that may include infoset
422      * augmentations.
423      *
424      * @throws XNIException Thrown by handler to signal an error.
425      */

426     public void startExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations)
427         throws XNIException {
428     } // startExternalSubset(Augmentations)
429

430     /**
431      * The end of the DTD external subset.
432      *
433      * @param augmentations Additional information that may include infoset
434      * augmentations.
435      *
436      * @throws XNIException Thrown by handler to signal an error.
437      */

438     public void endExternalSubset(Augmentations augmentations)
439         throws XNIException {
440     } // endExternalSubset(Augmentations)
441

442     /**
443      * This method notifies the start of an entity.
444      * <p>
445      * <strong>Note:</strong> This method is not called for entity references
446      * appearing as part of attribute values.
447      *
448      * @param name The name of the entity.
449      * @param identifier The resource identifier.
450      * @param encoding The auto-detected IANA encoding name of the entity
451      * stream. This value will be null in those situations
452      * where the entity encoding is not auto-detected (e.g.
453      * internal entities or a document entity that is
454      * parsed from a java.io.Reader).
455      * @param augs Additional information that may include infoset augmentations
456      *
457      * @exception XNIException Thrown by handler to signal an error.
458      */

459     public void startParameterEntity(String JavaDoc name,
460                                      XMLResourceIdentifier identifier,
461                                      String JavaDoc encoding,
462                                      Augmentations augs) throws XNIException {
463     } // startParameterEntity(String,XMLResourceIdentifier,String,Augmentations)
464

465     /**
466      * This method notifies the end of an entity.
467      * <p>
468      * <strong>Note:</strong> This method is not called for entity references
469      * appearing as part of attribute values.
470      *
471      * @param name The name of the entity.
472      * @param augs Additional information that may include infoset augmentations
473      *
474      * @exception XNIException
475      * Thrown by handler to signal an error.
476      */

477     public void endParameterEntity(String JavaDoc name, Augmentations augs)
478         throws XNIException {
479     } // endParameterEntity(String,Augmentations)
480

481     /**
482      * Characters within an IGNORE conditional section.
483      *
484      * @param text The ignored text.
485      * @param augs Additional information that may include infoset
486      * augmentations.
487      *
488      * @throws XNIException Thrown by handler to signal an error.
489      */

490      public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException {
491      } // ignoredCharacters(XMLString, Augmentations)
492

493     /**
494      * An element declaration.
495      *
496      * @param name The name of the element.
497      * @param contentModel The element content model.
498      * @param augs Additional information that may include infoset
499      * augmentations.
500      *
501      * @throws XNIException Thrown by handler to signal an error.
502      */

503     public void elementDecl(String JavaDoc name, String JavaDoc contentModel, Augmentations augs)
504         throws XNIException {
505     } // elementDecl(String,String)
506

507     /**
508      * The start of an attribute list.
509      *
510      * @param elementName The name of the element that this attribute
511      * list is associated with.
512      * @param augs Additional information that may include infoset
513      * augmentations.
514      *
515      * @throws XNIException Thrown by handler to signal an error.
516      */

517     public void startAttlist(String JavaDoc elementName, Augmentations augs) throws XNIException {
518     } // startAttlist(String)
519

520     /**
521      * An attribute declaration.
522      *
523      * @param elementName The name of the element that this attribute
524      * is associated with.
525      * @param attributeName The name of the attribute.
526      * @param type The attribute type. This value will be one of
527      * the following: "CDATA", "ENTITY", "ENTITIES",
528      * "ENUMERATION", "ID", "IDREF", "IDREFS",
529      * "NMTOKEN", "NMTOKENS", or "NOTATION".
530      * @param enumeration If the type has the value "ENUMERATION" or
531      * "NOTATION", this array holds the allowed attribute
532      * values; otherwise, this array is null.
533      * @param defaultType The attribute default type. This value will be
534      * one of the following: "#FIXED", "#IMPLIED",
535      * "#REQUIRED", or null.
536      * @param defaultValue The attribute default value, or null if no
537      * default value is specified.
538      * @param nonNormalizedDefaultValue The attribute default value with no normalization
539      * performed, or null if no default value is specified.
540      * @param augs Additional information that may include infoset
541      * augmentations.
542      *
543      * @throws XNIException Thrown by handler to signal an error.
544      */

545     public void attributeDecl(String JavaDoc elementName, String JavaDoc attributeName,
546                               String JavaDoc type, String JavaDoc[] enumeration,
547                               String JavaDoc defaultType, XMLString defaultValue,
548                   XMLString nonNormalizedDefaultValue, Augmentations augs)
549         throws XNIException {
550     } // attributeDecl(String,String,String,String[],String,XMLString, XMLString, Augmentations)
551

552     /**
553      * The end of an attribute list.
554      *
555      * @param augs Additional information that may include infoset
556      * augmentations.
557      *
558      * @throws XNIException Thrown by handler to signal an error.
559      */

560     public void endAttlist(Augmentations augs) throws XNIException {
561     } // endAttlist()
562

563     /**
564      * An internal entity declaration.
565      *
566      * @param name The name of the entity. Parameter entity names start with
567      * '%', whereas the name of a general entity is just the
568      * entity name.
569      * @param text The value of the entity.
570      * @param nonNormalizedText The non-normalized value of the entity. This
571      * value contains the same sequence of characters that was in
572      * the internal entity declaration, without any entity
573      * references expanded.
574      * @param augs Additional information that may include infoset
575      * augmentations.
576      *
577      * @throws XNIException Thrown by handler to signal an error.
578      */

579     public void internalEntityDecl(String JavaDoc name, XMLString text,
580                                    XMLString nonNormalizedText, Augmentations augs)
581         throws XNIException {
582     } // internalEntityDecl(String,XMLString,XMLString)
583

584     /**
585      * An external entity declaration.
586      *
587      * @param name The name of the entity. Parameter entity names start
588      * with '%', whereas the name of a general entity is just
589      * the entity name.
590      * @param identifier An object containing all location information
591      * pertinent to this entity.
592      * @param augs Additional information that may include infoset
593      * augmentations.
594      *
595      * @throws XNIException Thrown by handler to signal an error.
596      */

597     public void externalEntityDecl(String JavaDoc name, XMLResourceIdentifier identifier,
598                                    Augmentations augs) throws XNIException {
599     } // externalEntityDecl(String,XMLResourceIdentifier, Augmentations)
600

601     /**
602      * An unparsed entity declaration.
603      *
604      * @param name The name of the entity.
605      * @param identifier An object containing all location information
606      * pertinent to this entity.
607      * @param notation The name of the notation.
608      * @param augs Additional information that may include infoset
609      * augmentations.
610      *
611      * @throws XNIException Thrown by handler to signal an error.
612      */

613     public void unparsedEntityDecl(String JavaDoc name, XMLResourceIdentifier identifier,
614                                    String JavaDoc notation, Augmentations augs) throws XNIException {
615     } // unparsedEntityDecl(String,XMLResourceIdentifier, String, Augmentations)
616

617     /**
618      * A notation declaration
619      *
620      * @param name The name of the notation.
621      * @param identifier An object containing all location information
622      * pertinent to this notation.
623      * @param augs Additional information that may include infoset
624      * augmentations.
625      *
626      * @throws XNIException Thrown by handler to signal an error.
627      */

628     public void notationDecl(String JavaDoc name, XMLResourceIdentifier identifier,
629         Augmentations augs)
630         throws XNIException {
631     } // notationDecl(String,XMLResourceIdentifier, Augmentations)
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 augs 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 augs) throws XNIException {
647     } // startConditional(short)
648

649     /**
650      * The end of a conditional section.
651      *
652      * @param augs Additional information that may include infoset
653      * augmentations.
654      *
655      * @throws XNIException Thrown by handler to signal an error.
656      */

657     public void endConditional(Augmentations augs) throws XNIException {
658     } // endConditional()
659

660     /**
661      * The end of the DTD.
662      *
663      * @param augs Additional information that may include infoset
664      * augmentations.
665      *
666      * @throws XNIException Thrown by handler to signal an error.
667      */

668     public void endDTD(Augmentations augs) throws XNIException {
669         fInDTD = false;
670     } // endDTD()
671

672     // set the source of this handler
673
public void setDTDSource(XMLDTDSource source) {
674         fDTDSource = source;
675     }
676
677     // return the source from which this handler derives its events
678
public XMLDTDSource getDTDSource() {
679         return fDTDSource;
680     }
681
682     //
683
// XMLDTDContentModelHandler methods
684
//
685

686     /**
687      * The start of a content model. Depending on the type of the content
688      * model, specific methods may be called between the call to the
689      * startContentModel method and the call to the endContentModel method.
690      *
691      * @param elementName The name of the element.
692      * @param augs Additional information that may include infoset
693      * augmentations.
694      *
695      * @throws XNIException Thrown by handler to signal an error.
696      */

697     public void startContentModel(String JavaDoc elementName, Augmentations augs) throws XNIException {
698     } // startContentModel(String, Augmentations)
699

700     /**
701      * A content model of ANY.
702      *
703      * @param augs Additional information that may include infoset
704      * augmentations.
705      *
706      * @throws XNIException Thrown by handler to signal an error.
707      *
708      * @see #empty
709      * @see #startGroup
710      */

711     public void any(Augmentations augs) throws XNIException {
712     } // any(Augmentations)
713

714     /**
715      * A content model of EMPTY.
716      *
717      * @param augs Additional information that may include infoset
718      * augmentations.
719      *
720      * @throws XNIException Thrown by handler to signal an error.
721      *
722      * @see #any
723      * @see #startGroup
724      */

725     public void empty(Augmentations augs) throws XNIException {
726     } // empty(Augmentations)
727

728     /**
729      * A start of either a mixed or children content model. A mixed
730      * content model will immediately be followed by a call to the
731      * <code>pcdata()</code> method. A children content model will
732      * contain additional groups and/or elements.
733      *
734      * @param augs Additional information that may include infoset
735      * augmentations.
736      *
737      * @throws XNIException Thrown by handler to signal an error.
738      *
739      * @see #any
740      * @see #empty
741      */

742     public void startGroup(Augmentations augs) throws XNIException {
743     } // stargGroup(Augmentations)
744

745     /**
746      * The appearance of "#PCDATA" within a group signifying a
747      * mixed content model. This method will be the first called
748      * following the content model's <code>startGroup()</code>.
749      *
750      * @param augs Additional information that may include infoset
751      * augmentations.
752      *
753      * @throws XNIException Thrown by handler to signal an error.
754      *
755      * @see #startGroup
756      */

757     public void pcdata(Augmentations augs) throws XNIException {
758     } // pcdata(Augmentations)
759

760     /**
761      * A referenced element in a mixed or children content model.
762      *
763      * @param elementName The name of the referenced element.
764      * @param augs Additional information that may include infoset
765      * augmentations.
766      *
767      * @throws XNIException Thrown by handler to signal an error.
768      */

769     public void element(String JavaDoc elementName, Augmentations augs) throws XNIException {
770     } // element(String, Augmentations)
771

772     /**
773      * The separator between choices or sequences of a mixed or children
774      * content model.
775      *
776      * @param separator The type of children separator.
777      * @param augs Additional information that may include infoset
778      * augmentations.
779      *
780      * @throws XNIException Thrown by handler to signal an error.
781      *
782      * @see #SEPARATOR_CHOICE
783      * @see #SEPARATOR_SEQUENCE
784      */

785     public void separator(short separator, Augmentations augs) throws XNIException {
786     } // separator(short, Augmentations)
787

788     /**
789      * The occurrence count for a child in a children content model or
790      * for the mixed content model group.
791      *
792      * @param occurrence The occurrence count for the last element
793      * or group.
794      * @param augs Additional information that may include infoset
795      * augmentations.
796      *
797      * @throws XNIException Thrown by handler to signal an error.
798      *
799      * @see #OCCURS_ZERO_OR_ONE
800      * @see #OCCURS_ZERO_OR_MORE
801      * @see #OCCURS_ONE_OR_MORE
802      */

803     public void occurrence(short occurrence, Augmentations augs) throws XNIException {
804     } // occurence(short, Augmentations)
805

806     /**
807      * The end of a group for mixed or children content models.
808      *
809      * @param augs Additional information that may include infoset
810      * augmentations.
811      *
812      * @throws XNIException Thrown by handler to signal an error.
813      */

814     public void endGroup(Augmentations augs) throws XNIException {
815     } // endGroup(Augmentations)
816

817     /**
818      * The end of a content model.
819      *
820      * @param augs Additional information that may include infoset
821      * augmentations.
822      *
823      * @throws XNIException Thrown by handler to signal an error.
824      */

825     public void endContentModel(Augmentations augs) throws XNIException {
826     } // endContentModel(Augmentations)
827

828     // set content model source
829
public void setDTDContentModelSource(XMLDTDContentModelSource source) {
830         fDTDContentModelSource = source;
831     }
832
833     // get content model source
834
public XMLDTDContentModelSource getDTDContentModelSource() {
835         return fDTDContentModelSource;
836     }
837
838     //
839
// Protected methods
840
//
841

842     /**
843      * reset all components before parsing
844      */

845     protected void reset() throws XNIException {
846         super.reset();
847         fInDTD = false;
848     } // reset()
849

850 } // class AbstractXMLDocumentParser
851
Popular Tags