001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.xerces.parsers;
019:
020: import org.apache.xerces.xni.Augmentations;
021: import org.apache.xerces.xni.NamespaceContext;
022: import org.apache.xerces.xni.QName;
023: import org.apache.xerces.xni.XMLAttributes;
024: import org.apache.xerces.xni.XMLDTDContentModelHandler;
025: import org.apache.xerces.xni.XMLDTDHandler;
026: import org.apache.xerces.xni.XMLDocumentHandler;
027: import org.apache.xerces.xni.XMLLocator;
028: import org.apache.xerces.xni.XMLResourceIdentifier;
029: import org.apache.xerces.xni.XMLString;
030: import org.apache.xerces.xni.XNIException;
031: import org.apache.xerces.xni.parser.XMLDTDContentModelSource;
032: import org.apache.xerces.xni.parser.XMLDTDSource;
033: import org.apache.xerces.xni.parser.XMLDocumentSource;
034: import org.apache.xerces.xni.parser.XMLParserConfiguration;
035:
036: /**
037: * This is the base class for all XML document parsers. XMLDocumentParser
038: * provides a common implementation shared by the various document parsers
039: * in the Xerces package. While this class is provided for convenience, it
040: * does not prevent other kinds of parsers to be constructed using the XNI
041: * interfaces.
042: *
043: * @author Arnaud Le Hors, IBM
044: * @author Andy Clark, IBM
045: *
046: * @version $Id: AbstractXMLDocumentParser.java 447239 2006-09-18 05:08:26Z mrglavas $
047: */
048: public abstract class AbstractXMLDocumentParser extends XMLParser
049: implements XMLDocumentHandler, XMLDTDHandler,
050: XMLDTDContentModelHandler {
051:
052: //
053: // Data
054: //
055:
056: // state
057:
058: /** True if inside DTD. */
059: protected boolean fInDTD;
060:
061: /** Document source*/
062: protected XMLDocumentSource fDocumentSource;
063:
064: /** DTD source*/
065: protected XMLDTDSource fDTDSource;
066:
067: /** DTD content model source*/
068: protected XMLDTDContentModelSource fDTDContentModelSource;
069:
070: //
071: // Constructors
072: //
073:
074: /**
075: * Constructs a document parser using the default symbol table
076: * and grammar pool.
077: */
078: protected AbstractXMLDocumentParser(XMLParserConfiguration config) {
079: super (config);
080:
081: // set handlers
082: config.setDocumentHandler(this );
083: config.setDTDHandler(this );
084: config.setDTDContentModelHandler(this );
085:
086: } // <init>(XMLParserConfiguration)
087:
088: //
089: // XMLDocumentHandler methods
090: //
091:
092: /**
093: * The start of the document.
094: *
095: * @param locator The system identifier of the entity if the entity
096: * is external, null otherwise.
097: * @param encoding The auto-detected IANA encoding name of the entity
098: * stream. This value will be null in those situations
099: * where the entity encoding is not auto-detected (e.g.
100: * internal entities or a document entity that is
101: * parsed from a java.io.Reader).
102: * @param namespaceContext
103: * The namespace context in effect at the
104: * start of this document.
105: * This object represents the current context.
106: * Implementors of this class are responsible
107: * for copying the namespace bindings from the
108: * the current context (and its parent contexts)
109: * if that information is important.
110: * @param augs Additional information that may include infoset augmentations
111: *
112: * @throws XNIException Thrown by handler to signal an error.
113: */
114:
115: public void startDocument(XMLLocator locator, String encoding,
116: NamespaceContext namespaceContext, Augmentations augs)
117: throws XNIException {
118: } // startDocument(XMLLocator,String)
119:
120: /**
121: * Notifies of the presence of an XMLDecl line in the document. If
122: * present, this method will be called immediately following the
123: * startDocument call.
124: *
125: * @param version The XML version.
126: * @param encoding The IANA encoding name of the document, or null if
127: * not specified.
128: * @param standalone The standalone value, or null if not specified.
129: * @param augs Additional information that may include infoset augmentations
130: *
131: * @throws XNIException Thrown by handler to signal an error.
132: */
133: public void xmlDecl(String version, String encoding,
134: String standalone, Augmentations augs) throws XNIException {
135: } // xmlDecl(String,String,String)
136:
137: /**
138: * Notifies of the presence of the DOCTYPE line in the document.
139: *
140: * @param rootElement The name of the root element.
141: * @param publicId The public identifier if an external DTD or null
142: * if the external DTD is specified using SYSTEM.
143: * @param systemId The system identifier if an external DTD, null
144: * @param augs Additional information that may include infoset augmentations
145: * otherwise.
146: *
147: * @throws XNIException Thrown by handler to signal an error.
148: */
149: public void doctypeDecl(String rootElement, String publicId,
150: String systemId, Augmentations augs) throws XNIException {
151: } // doctypeDecl(String,String,String)
152:
153: /**
154: * The start of an element. If the document specifies the start element
155: * by using an empty tag, then the startElement method will immediately
156: * be followed by the endElement method, with no intervening methods.
157: *
158: * @param element The name of the element.
159: * @param attributes The element attributes.
160: * @param augs Additional information that may include infoset augmentations
161: *
162: * @throws XNIException Thrown by handler to signal an error.
163: */
164: public void startElement(QName element, XMLAttributes attributes,
165: Augmentations augs) throws XNIException {
166: } // startElement(QName,XMLAttributes)
167:
168: /**
169: * An empty element.
170: *
171: * @param element The name of the element.
172: * @param attributes The element attributes.
173: * @param augs Additional information that may include infoset augmentations
174: *
175: * @throws XNIException Thrown by handler to signal an error.
176: */
177: public void emptyElement(QName element, XMLAttributes attributes,
178: Augmentations augs) throws XNIException {
179:
180: startElement(element, attributes, augs);
181: endElement(element, augs);
182:
183: } // emptyElement(QName,XMLAttributes)
184:
185: /**
186: * Character content.
187: *
188: * @param text The content.
189: * @param augs Additional information that may include infoset augmentations
190: *
191: * @throws XNIException Thrown by handler to signal an error.
192: */
193: public void characters(XMLString text, Augmentations augs)
194: throws XNIException {
195: } // characters(XMLString)
196:
197: /**
198: * Ignorable whitespace. For this method to be called, the document
199: * source must have some way of determining that the text containing
200: * only whitespace characters should be considered ignorable. For
201: * example, the validator can determine if a length of whitespace
202: * characters in the document are ignorable based on the element
203: * content model.
204: *
205: * @param text The ignorable whitespace.
206: * @param augs Additional information that may include infoset augmentations
207: *
208: * @throws XNIException Thrown by handler to signal an error.
209: */
210: public void ignorableWhitespace(XMLString text, Augmentations augs)
211: throws XNIException {
212: } // ignorableWhitespace(XMLString)
213:
214: /**
215: * The end of an element.
216: *
217: * @param element The name of the element.
218: * @param augs Additional information that may include infoset augmentations
219: *
220: * @throws XNIException Thrown by handler to signal an error.
221: */
222: public void endElement(QName element, Augmentations augs)
223: throws XNIException {
224: } // endElement(QName)
225:
226: /**
227: * The start of a CDATA section.
228: * @param augs Additional information that may include infoset augmentations
229: *
230: * @throws XNIException Thrown by handler to signal an error.
231: */
232: public void startCDATA(Augmentations augs) throws XNIException {
233: } // startCDATA()
234:
235: /**
236: * The end of a CDATA section.
237: * @param augs Additional information that may include infoset augmentations
238: *
239: * @throws XNIException Thrown by handler to signal an error.
240: */
241: public void endCDATA(Augmentations augs) throws XNIException {
242: } // endCDATA()
243:
244: /**
245: * The end of the document.
246: * @param augs Additional information that may include infoset augmentations
247: *
248: * @throws XNIException Thrown by handler to signal an error.
249: */
250: public void endDocument(Augmentations augs) throws XNIException {
251: } // endDocument()
252:
253: /**
254: * This method notifies the start of an entity.
255: * <p>
256: * <strong>Note:</strong> This method is not called for entity references
257: * appearing as part of attribute values.
258: *
259: * @param name The name of the entity.
260: * @param identifier The resource identifier.
261: * @param encoding The auto-detected IANA encoding name of the entity
262: * stream. This value will be null in those situations
263: * where the entity encoding is not auto-detected (e.g.
264: * internal entities or a document entity that is
265: * parsed from a java.io.Reader).
266: * @param augs Additional information that may include infoset augmentations
267: *
268: * @exception XNIException Thrown by handler to signal an error.
269: */
270: public void startGeneralEntity(String name,
271: XMLResourceIdentifier identifier, String encoding,
272: Augmentations augs) throws XNIException {
273: } // startGeneralEntity(String,XMLResourceIdentifier,String,Augmentations)
274:
275: /**
276: * Notifies of the presence of a TextDecl line in an entity. If present,
277: * this method will be called immediately following the startEntity call.
278: * <p>
279: * <strong>Note:</strong> This method will never be called for the
280: * document entity; it is only called for external general entities
281: * referenced in document content.
282: * <p>
283: * <strong>Note:</strong> This method is not called for entity references
284: * appearing as part of attribute values.
285: *
286: * @param version The XML version, or null if not specified.
287: * @param encoding The IANA encoding name of the entity.
288: * @param augs Additional information that may include infoset augmentations
289: *
290: * @exception XNIException
291: * Thrown by handler to signal an error.
292: */
293: public void textDecl(String version, String encoding,
294: Augmentations augs) throws XNIException {
295: } // textDecl(String, String, Augmentations)
296:
297: /**
298: * This method notifies the end of an entity.
299: * <p>
300: * <strong>Note:</strong> This method is not called for entity references
301: * appearing as part of attribute values.
302: *
303: * @param name The name of the entity.
304: * @param augs Additional information that may include infoset augmentations
305: *
306: * @exception XNIException
307: * Thrown by handler to signal an error.
308: */
309: public void endGeneralEntity(String name, Augmentations augs)
310: throws XNIException {
311: } // endGeneralEntity(String,Augmentations)
312:
313: /**
314: * A comment.
315: *
316: * @param text The text in the comment.
317: * @param augs Additional information that may include infoset augmentations
318: *
319: * @exception XNIException
320: * Thrown by application to signal an error.
321: */
322: public void comment(XMLString text, Augmentations augs)
323: throws XNIException {
324: } // comment (XMLString, Augmentations)
325:
326: /**
327: * A processing instruction. Processing instructions consist of a
328: * target name and, optionally, text data. The data is only meaningful
329: * to the application.
330: * <p>
331: * Typically, a processing instruction's data will contain a series
332: * of pseudo-attributes. These pseudo-attributes follow the form of
333: * element attributes but are <strong>not</strong> parsed or presented
334: * to the application as anything other than text. The application is
335: * responsible for parsing the data.
336: *
337: * @param target The target.
338: * @param data The data or null if none specified.
339: * @param augs Additional information that may include infoset augmentations
340: *
341: * @exception XNIException
342: * Thrown by handler to signal an error.
343: */
344: public void processingInstruction(String target, XMLString data,
345: Augmentations augs) throws XNIException {
346: } // processingInstruction(String, XMLString, Augmentations)
347:
348: /** Sets the document source */
349: public void setDocumentSource(XMLDocumentSource source) {
350: fDocumentSource = source;
351: } // setDocumentSource
352:
353: /** Returns the document source */
354: public XMLDocumentSource getDocumentSource() {
355: return fDocumentSource;
356: } // getDocumentSource
357:
358: //
359: // XMLDTDHandler methods
360: //
361:
362: /**
363: * The start of the DTD.
364: *
365: * @param locator The document locator, or null if the document
366: * location cannot be reported during the parsing of
367: * the document DTD. However, it is <em>strongly</em>
368: * recommended that a locator be supplied that can
369: * at least report the base system identifier of the
370: * DTD.
371: * @param augs Additional information that may include infoset
372: * augmentations.
373: *
374: * @throws XNIException Thrown by handler to signal an error.
375: */
376: public void startDTD(XMLLocator locator, Augmentations augs)
377: throws XNIException {
378: fInDTD = true;
379: } // startDTD(XMLLocator)
380:
381: /**
382: * The start of the DTD external subset.
383: *
384: * @param augmentations Additional information that may include infoset
385: * augmentations.
386: *
387: * @throws XNIException Thrown by handler to signal an error.
388: */
389: public void startExternalSubset(XMLResourceIdentifier identifier,
390: Augmentations augmentations) throws XNIException {
391: } // startExternalSubset(Augmentations)
392:
393: /**
394: * The end of the DTD external subset.
395: *
396: * @param augmentations Additional information that may include infoset
397: * augmentations.
398: *
399: * @throws XNIException Thrown by handler to signal an error.
400: */
401: public void endExternalSubset(Augmentations augmentations)
402: throws XNIException {
403: } // endExternalSubset(Augmentations)
404:
405: /**
406: * This method notifies the start of an entity.
407: * <p>
408: * <strong>Note:</strong> This method is not called for entity references
409: * appearing as part of attribute values.
410: *
411: * @param name The name of the entity.
412: * @param identifier The resource identifier.
413: * @param encoding The auto-detected IANA encoding name of the entity
414: * stream. This value will be null in those situations
415: * where the entity encoding is not auto-detected (e.g.
416: * internal entities or a document entity that is
417: * parsed from a java.io.Reader).
418: * @param augs Additional information that may include infoset augmentations
419: *
420: * @exception XNIException Thrown by handler to signal an error.
421: */
422: public void startParameterEntity(String name,
423: XMLResourceIdentifier identifier, String encoding,
424: Augmentations augs) throws XNIException {
425: } // startParameterEntity(String,XMLResourceIdentifier,String,Augmentations)
426:
427: /**
428: * This method notifies the end of an entity.
429: * <p>
430: * <strong>Note:</strong> This method is not called for entity references
431: * appearing as part of attribute values.
432: *
433: * @param name The name of the entity.
434: * @param augs Additional information that may include infoset augmentations
435: *
436: * @exception XNIException
437: * Thrown by handler to signal an error.
438: */
439: public void endParameterEntity(String name, Augmentations augs)
440: throws XNIException {
441: } // endParameterEntity(String,Augmentations)
442:
443: /**
444: * Characters within an IGNORE conditional section.
445: *
446: * @param text The ignored text.
447: * @param augs Additional information that may include infoset
448: * augmentations.
449: *
450: * @throws XNIException Thrown by handler to signal an error.
451: */
452: public void ignoredCharacters(XMLString text, Augmentations augs)
453: throws XNIException {
454: } // ignoredCharacters(XMLString, Augmentations)
455:
456: /**
457: * An element declaration.
458: *
459: * @param name The name of the element.
460: * @param contentModel The element content model.
461: * @param augs Additional information that may include infoset
462: * augmentations.
463: *
464: * @throws XNIException Thrown by handler to signal an error.
465: */
466: public void elementDecl(String name, String contentModel,
467: Augmentations augs) throws XNIException {
468: } // elementDecl(String,String)
469:
470: /**
471: * The start of an attribute list.
472: *
473: * @param elementName The name of the element that this attribute
474: * list is associated with.
475: * @param augs Additional information that may include infoset
476: * augmentations.
477: *
478: * @throws XNIException Thrown by handler to signal an error.
479: */
480: public void startAttlist(String elementName, Augmentations augs)
481: throws XNIException {
482: } // startAttlist(String)
483:
484: /**
485: * An attribute declaration.
486: *
487: * @param elementName The name of the element that this attribute
488: * is associated with.
489: * @param attributeName The name of the attribute.
490: * @param type The attribute type. This value will be one of
491: * the following: "CDATA", "ENTITY", "ENTITIES",
492: * "ENUMERATION", "ID", "IDREF", "IDREFS",
493: * "NMTOKEN", "NMTOKENS", or "NOTATION".
494: * @param enumeration If the type has the value "ENUMERATION" or
495: * "NOTATION", this array holds the allowed attribute
496: * values; otherwise, this array is null.
497: * @param defaultType The attribute default type. This value will be
498: * one of the following: "#FIXED", "#IMPLIED",
499: * "#REQUIRED", or null.
500: * @param defaultValue The attribute default value, or null if no
501: * default value is specified.
502: * @param nonNormalizedDefaultValue The attribute default value with no normalization
503: * performed, or null if no default value is specified.
504: * @param augs Additional information that may include infoset
505: * augmentations.
506: *
507: * @throws XNIException Thrown by handler to signal an error.
508: */
509: public void attributeDecl(String elementName, String attributeName,
510: String type, String[] enumeration, String defaultType,
511: XMLString defaultValue,
512: XMLString nonNormalizedDefaultValue, Augmentations augs)
513: throws XNIException {
514: } // attributeDecl(String,String,String,String[],String,XMLString, XMLString, Augmentations)
515:
516: /**
517: * The end of an attribute list.
518: *
519: * @param augs Additional information that may include infoset
520: * augmentations.
521: *
522: * @throws XNIException Thrown by handler to signal an error.
523: */
524: public void endAttlist(Augmentations augs) throws XNIException {
525: } // endAttlist()
526:
527: /**
528: * An internal entity declaration.
529: *
530: * @param name The name of the entity. Parameter entity names start with
531: * '%', whereas the name of a general entity is just the
532: * entity name.
533: * @param text The value of the entity.
534: * @param nonNormalizedText The non-normalized value of the entity. This
535: * value contains the same sequence of characters that was in
536: * the internal entity declaration, without any entity
537: * references expanded.
538: * @param augs Additional information that may include infoset
539: * augmentations.
540: *
541: * @throws XNIException Thrown by handler to signal an error.
542: */
543: public void internalEntityDecl(String name, XMLString text,
544: XMLString nonNormalizedText, Augmentations augs)
545: throws XNIException {
546: } // internalEntityDecl(String,XMLString,XMLString)
547:
548: /**
549: * An external entity declaration.
550: *
551: * @param name The name of the entity. Parameter entity names start
552: * with '%', whereas the name of a general entity is just
553: * the entity name.
554: * @param identifier An object containing all location information
555: * pertinent to this entity.
556: * @param augs Additional information that may include infoset
557: * augmentations.
558: *
559: * @throws XNIException Thrown by handler to signal an error.
560: */
561: public void externalEntityDecl(String name,
562: XMLResourceIdentifier identifier, Augmentations augs)
563: throws XNIException {
564: } // externalEntityDecl(String,XMLResourceIdentifier, Augmentations)
565:
566: /**
567: * An unparsed entity declaration.
568: *
569: * @param name The name of the entity.
570: * @param identifier An object containing all location information
571: * pertinent to this entity.
572: * @param notation The name of the notation.
573: * @param augs Additional information that may include infoset
574: * augmentations.
575: *
576: * @throws XNIException Thrown by handler to signal an error.
577: */
578: public void unparsedEntityDecl(String name,
579: XMLResourceIdentifier identifier, String notation,
580: Augmentations augs) throws XNIException {
581: } // unparsedEntityDecl(String,XMLResourceIdentifier, String, Augmentations)
582:
583: /**
584: * A notation declaration
585: *
586: * @param name The name of the notation.
587: * @param identifier An object containing all location information
588: * pertinent to this notation.
589: * @param augs Additional information that may include infoset
590: * augmentations.
591: *
592: * @throws XNIException Thrown by handler to signal an error.
593: */
594: public void notationDecl(String name,
595: XMLResourceIdentifier identifier, Augmentations augs)
596: throws XNIException {
597: } // notationDecl(String,XMLResourceIdentifier, Augmentations)
598:
599: /**
600: * The start of a conditional section.
601: *
602: * @param type The type of the conditional section. This value will
603: * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
604: * @param augs Additional information that may include infoset
605: * augmentations.
606: *
607: * @throws XNIException Thrown by handler to signal an error.
608: *
609: * @see #CONDITIONAL_INCLUDE
610: * @see #CONDITIONAL_IGNORE
611: */
612: public void startConditional(short type, Augmentations augs)
613: throws XNIException {
614: } // startConditional(short)
615:
616: /**
617: * The end of a conditional section.
618: *
619: * @param augs Additional information that may include infoset
620: * augmentations.
621: *
622: * @throws XNIException Thrown by handler to signal an error.
623: */
624: public void endConditional(Augmentations augs) throws XNIException {
625: } // endConditional()
626:
627: /**
628: * The end of the DTD.
629: *
630: * @param augs Additional information that may include infoset
631: * augmentations.
632: *
633: * @throws XNIException Thrown by handler to signal an error.
634: */
635: public void endDTD(Augmentations augs) throws XNIException {
636: fInDTD = false;
637: } // endDTD()
638:
639: // set the source of this handler
640: public void setDTDSource(XMLDTDSource source) {
641: fDTDSource = source;
642: }
643:
644: // return the source from which this handler derives its events
645: public XMLDTDSource getDTDSource() {
646: return fDTDSource;
647: }
648:
649: //
650: // XMLDTDContentModelHandler methods
651: //
652:
653: /**
654: * The start of a content model. Depending on the type of the content
655: * model, specific methods may be called between the call to the
656: * startContentModel method and the call to the endContentModel method.
657: *
658: * @param elementName The name of the element.
659: * @param augs Additional information that may include infoset
660: * augmentations.
661: *
662: * @throws XNIException Thrown by handler to signal an error.
663: */
664: public void startContentModel(String elementName, Augmentations augs)
665: throws XNIException {
666: } // startContentModel(String, Augmentations)
667:
668: /**
669: * A content model of ANY.
670: *
671: * @param augs Additional information that may include infoset
672: * augmentations.
673: *
674: * @throws XNIException Thrown by handler to signal an error.
675: *
676: * @see #empty
677: * @see #startGroup
678: */
679: public void any(Augmentations augs) throws XNIException {
680: } // any(Augmentations)
681:
682: /**
683: * A content model of EMPTY.
684: *
685: * @param augs Additional information that may include infoset
686: * augmentations.
687: *
688: * @throws XNIException Thrown by handler to signal an error.
689: *
690: * @see #any
691: * @see #startGroup
692: */
693: public void empty(Augmentations augs) throws XNIException {
694: } // empty(Augmentations)
695:
696: /**
697: * A start of either a mixed or children content model. A mixed
698: * content model will immediately be followed by a call to the
699: * <code>pcdata()</code> method. A children content model will
700: * contain additional groups and/or elements.
701: *
702: * @param augs Additional information that may include infoset
703: * augmentations.
704: *
705: * @throws XNIException Thrown by handler to signal an error.
706: *
707: * @see #any
708: * @see #empty
709: */
710: public void startGroup(Augmentations augs) throws XNIException {
711: } // stargGroup(Augmentations)
712:
713: /**
714: * The appearance of "#PCDATA" within a group signifying a
715: * mixed content model. This method will be the first called
716: * following the content model's <code>startGroup()</code>.
717: *
718: * @param augs Additional information that may include infoset
719: * augmentations.
720: *
721: * @throws XNIException Thrown by handler to signal an error.
722: *
723: * @see #startGroup
724: */
725: public void pcdata(Augmentations augs) throws XNIException {
726: } // pcdata(Augmentations)
727:
728: /**
729: * A referenced element in a mixed or children content model.
730: *
731: * @param elementName The name of the referenced element.
732: * @param augs Additional information that may include infoset
733: * augmentations.
734: *
735: * @throws XNIException Thrown by handler to signal an error.
736: */
737: public void element(String elementName, Augmentations augs)
738: throws XNIException {
739: } // element(String, Augmentations)
740:
741: /**
742: * The separator between choices or sequences of a mixed or children
743: * content model.
744: *
745: * @param separator The type of children separator.
746: * @param augs Additional information that may include infoset
747: * augmentations.
748: *
749: * @throws XNIException Thrown by handler to signal an error.
750: *
751: * @see #SEPARATOR_CHOICE
752: * @see #SEPARATOR_SEQUENCE
753: */
754: public void separator(short separator, Augmentations augs)
755: throws XNIException {
756: } // separator(short, Augmentations)
757:
758: /**
759: * The occurrence count for a child in a children content model or
760: * for the mixed content model group.
761: *
762: * @param occurrence The occurrence count for the last element
763: * or group.
764: * @param augs Additional information that may include infoset
765: * augmentations.
766: *
767: * @throws XNIException Thrown by handler to signal an error.
768: *
769: * @see #OCCURS_ZERO_OR_ONE
770: * @see #OCCURS_ZERO_OR_MORE
771: * @see #OCCURS_ONE_OR_MORE
772: */
773: public void occurrence(short occurrence, Augmentations augs)
774: throws XNIException {
775: } // occurence(short, Augmentations)
776:
777: /**
778: * The end of a group for mixed or children content models.
779: *
780: * @param augs Additional information that may include infoset
781: * augmentations.
782: *
783: * @throws XNIException Thrown by handler to signal an error.
784: */
785: public void endGroup(Augmentations augs) throws XNIException {
786: } // endGroup(Augmentations)
787:
788: /**
789: * The end of a content model.
790: *
791: * @param augs Additional information that may include infoset
792: * augmentations.
793: *
794: * @throws XNIException Thrown by handler to signal an error.
795: */
796: public void endContentModel(Augmentations augs) throws XNIException {
797: } // endContentModel(Augmentations)
798:
799: // set content model source
800: public void setDTDContentModelSource(XMLDTDContentModelSource source) {
801: fDTDContentModelSource = source;
802: }
803:
804: // get content model source
805: public XMLDTDContentModelSource getDTDContentModelSource() {
806: return fDTDContentModelSource;
807: }
808:
809: //
810: // Protected methods
811: //
812:
813: /**
814: * reset all components before parsing
815: */
816: protected void reset() throws XNIException {
817: super .reset();
818: fInDTD = false;
819: } // reset()
820:
821: } // class AbstractXMLDocumentParser
|