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: package org.apache.cocoon.xml;
018:
019: import org.apache.avalon.framework.logger.AbstractLogEnabled;
020: import org.xml.sax.Attributes;
021: import org.xml.sax.Locator;
022: import org.xml.sax.SAXException;
023:
024: /**
025: * This abstract class provides default implementation of the methods specified
026: * by the <code>XMLConsumer</code> interface.
027: *
028: * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
029: * (Apache Software Foundation)
030: * @version CVS $Id: AbstractXMLConsumer.java 433543 2006-08-22 06:22:54Z crossley $
031: */
032: public abstract class AbstractXMLConsumer extends AbstractLogEnabled
033: implements XMLConsumer {
034:
035: /**
036: * Receive an object for locating the origin of SAX document events.
037: *
038: * @param locator An object that can return the location of any SAX
039: * document event.
040: */
041: public void setDocumentLocator(Locator locator) {
042: }
043:
044: /**
045: * Receive notification of the beginning of a document.
046: */
047: public void startDocument() throws SAXException {
048: }
049:
050: /**
051: * Receive notification of the end of a document.
052: */
053: public void endDocument() throws SAXException {
054: }
055:
056: /**
057: * Begin the scope of a prefix-URI Namespace mapping.
058: *
059: * @param prefix The Namespace prefix being declared.
060: * @param uri The Namespace URI the prefix is mapped to.
061: */
062: public void startPrefixMapping(String prefix, String uri)
063: throws SAXException {
064: }
065:
066: /**
067: * End the scope of a prefix-URI mapping.
068: *
069: * @param prefix The prefix that was being mapping.
070: */
071: public void endPrefixMapping(String prefix) throws SAXException {
072: }
073:
074: /**
075: * Receive notification of the beginning of an element.
076: *
077: * @param uri The Namespace URI, or the empty string if the element has no
078: * Namespace URI or if Namespace
079: * processing is not being performed.
080: * @param loc The local name (without prefix), or the empty string if
081: * Namespace processing is not being performed.
082: * @param raw The raw XML 1.0 name (with prefix), or the empty string if
083: * raw names are not available.
084: * @param a The attributes attached to the element. If there are no
085: * attributes, it shall be an empty Attributes object.
086: */
087: public void startElement(String uri, String loc, String raw,
088: Attributes a) throws SAXException {
089: }
090:
091: /**
092: * Receive notification of the end of an element.
093: *
094: * @param uri The Namespace URI, or the empty string if the element has no
095: * Namespace URI or if Namespace
096: * processing is not being performed.
097: * @param loc The local name (without prefix), or the empty string if
098: * Namespace processing is not being performed.
099: * @param raw The raw XML 1.0 name (with prefix), or the empty string if
100: * raw names are not available.
101: */
102: public void endElement(String uri, String loc, String raw)
103: throws SAXException {
104: }
105:
106: /**
107: * Receive notification of character data.
108: *
109: * @param ch The characters from the XML document.
110: * @param start The start position in the array.
111: * @param len The number of characters to read from the array.
112: */
113: public void characters(char ch[], int start, int len)
114: throws SAXException {
115: }
116:
117: /**
118: * Receive notification of ignorable whitespace in element content.
119: *
120: * @param ch The characters from the XML document.
121: * @param start The start position in the array.
122: * @param len The number of characters to read from the array.
123: */
124: public void ignorableWhitespace(char ch[], int start, int len)
125: throws SAXException {
126: }
127:
128: /**
129: * Receive notification of a processing instruction.
130: *
131: * @param target The processing instruction target.
132: * @param data The processing instruction data, or null if none was
133: * supplied.
134: */
135: public void processingInstruction(String target, String data)
136: throws SAXException {
137: }
138:
139: /**
140: * Receive notification of a skipped entity.
141: *
142: * @param name The name of the skipped entity. If it is a parameter
143: * entity, the name will begin with '%'.
144: */
145: public void skippedEntity(String name) throws SAXException {
146: }
147:
148: /**
149: * Report the start of DTD declarations, if any.
150: *
151: * @param name The document type name.
152: * @param publicId The declared public identifier for the external DTD
153: * subset, or null if none was declared.
154: * @param systemId The declared system identifier for the external DTD
155: * subset, or null if none was declared.
156: */
157: public void startDTD(String name, String publicId, String systemId)
158: throws SAXException {
159: }
160:
161: /**
162: * Report the end of DTD declarations.
163: */
164: public void endDTD() throws SAXException {
165: }
166:
167: /**
168: * Report the beginning of an entity.
169: *
170: * @param name The name of the entity. If it is a parameter entity, the
171: * name will begin with '%'.
172: */
173: public void startEntity(String name) throws SAXException {
174: }
175:
176: /**
177: * Report the end of an entity.
178: *
179: * @param name The name of the entity that is ending.
180: */
181: public void endEntity(String name) throws SAXException {
182: }
183:
184: /**
185: * Report the start of a CDATA section.
186: */
187: public void startCDATA() throws SAXException {
188: }
189:
190: /**
191: * Report the end of a CDATA section.
192: */
193: public void endCDATA() throws SAXException {
194: }
195:
196: /**
197: * Report an XML comment anywhere in the document.
198: *
199: * @param ch An array holding the characters in the comment.
200: * @param start The starting position in the array.
201: * @param len The number of characters to use from the array.
202: */
203: public void comment(char ch[], int start, int len)
204: throws SAXException {
205: }
206: }
|