001: /* Copyright 2000 - 2001 Quadcap Software. All rights reserved.
002: *
003: * This software is distributed under the Quadcap Free Software License.
004: * This software may be used or modified for any purpose, personal or
005: * commercial. Open Source redistributions are permitted. Commercial
006: * redistribution of larger works derived from, or works which bundle
007: * this software requires a "Commercial Redistribution License"; see
008: * http://www.quadcap.com/purchase.
009: *
010: * Redistributions qualify as "Open Source" under one of the following terms:
011: *
012: * Redistributions are made at no charge beyond the reasonable cost of
013: * materials and delivery.
014: *
015: * Redistributions are accompanied by a copy of the Source Code or by an
016: * irrevocable offer to provide a copy of the Source Code for up to three
017: * years at the cost of materials and delivery. Such redistributions
018: * must allow further use, modification, and redistribution of the Source
019: * Code under substantially the same terms as this license.
020: *
021: * Redistributions of source code must retain the copyright notices as they
022: * appear in each source code file, these license terms, and the
023: * disclaimer/limitation of liability set forth as paragraph 6 below.
024: *
025: * Redistributions in binary form must reproduce this Copyright Notice,
026: * these license terms, and the disclaimer/limitation of liability set
027: * forth as paragraph 6 below, in the documentation and/or other materials
028: * provided with the distribution.
029: *
030: * The Software is provided on an "AS IS" basis. No warranty is
031: * provided that the Software is free of defects, or fit for a
032: * particular purpose.
033: *
034: * Limitation of Liability. Quadcap Software shall not be liable
035: * for any damages suffered by the Licensee or any third party resulting
036: * from use of the Software.
037: */
038:
039: // SAX DTD handler.
040: // No warranty; no copyright -- use this as you will.
041: // $Id: DTDHandler.java,v 1.3 2001/01/06 06:11:01 stan Exp $
042: package org.xml.sax;
043:
044: /**
045: * Receive notification of basic DTD-related events.
046: *
047: * <p>If a SAX application needs information about notations and
048: * unparsed entities, then the application implements this
049: * interface and registers an instance with the SAX parser using
050: * the parser's setDTDHandler method. The parser uses the
051: * instance to report notation and unparsed entity declarations to
052: * the application.</p>
053: *
054: * <p>The SAX parser may report these events in any order, regardless
055: * of the order in which the notations and unparsed entities were
056: * declared; however, all DTD events must be reported after the
057: * document handler's startDocument event, and before the first
058: * startElement event.</p>
059: *
060: * <p>It is up to the application to store the information for
061: * future use (perhaps in a hash table or object tree).
062: * If the application encounters attributes of type "NOTATION",
063: * "ENTITY", or "ENTITIES", it can use the information that it
064: * obtained through this interface to find the entity and/or
065: * notation corresponding with the attribute value.</p>
066: *
067: * <p>The HandlerBase class provides a default implementation
068: * of this interface, which simply ignores the events.</p>
069: *
070: * @author David Megginson (ak117@freenet.carleton.ca)
071: * @version 1.0
072: * @see org.xml.sax.Parser#setDTDHandler
073: * @see org.xml.sax.HandlerBase
074: */
075: public interface DTDHandler {
076:
077: /**
078: * Receive notification of a notation declaration event.
079: *
080: * <p>It is up to the application to record the notation for later
081: * reference, if necessary.</p>
082: *
083: * <p>If a system identifier is present, and it is a URL, the SAX
084: * parser must resolve it fully before passing it to the
085: * application.</p>
086: *
087: * @param name The notation name.
088: * @param publicId The notation's public identifier, or null if
089: * none was given.
090: * @param systemId The notation's system identifier, or null if
091: * none was given.
092: * @exception org.xml.sax.SAXException Any SAX exception, possibly
093: * wrapping another exception.
094: * @see #unparsedEntityDecl
095: * @see org.xml.sax.AttributeList
096: */
097: public abstract void notationDecl(String name, String publicId,
098: String systemId) throws SAXException;
099:
100: /**
101: * Receive notification of an unparsed entity declaration event.
102: *
103: * <p>Note that the notation name corresponds to a notation
104: * reported by the notationDecl() event. It is up to the
105: * application to record the entity for later reference, if
106: * necessary.</p>
107: *
108: * <p>If the system identifier is a URL, the parser must resolve it
109: * fully before passing it to the application.</p>
110: *
111: * @exception org.xml.sax.SAXException Any SAX exception, possibly
112: * wrapping another exception.
113: * @param name The unparsed entity's name.
114: * @param publicId The entity's public identifier, or null if none
115: * was given.
116: * @param systemId The entity's system identifier (it must always
117: * have one).
118: * @param notation name The name of the associated notation.
119: * @see #notationDecl
120: * @see org.xml.sax.AttributeList
121: */
122: public abstract void unparsedEntityDecl(String name,
123: String publicId, String systemId, String notationName)
124: throws SAXException;
125:
126: }
|