KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xmlpull > v1 > sax2 > AttributesCachingDriver


1 /* -*- mode: Java; c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/
2
3 package org.xmlpull.v1.sax2;
4
5 import org.xml.sax.SAXException JavaDoc;
6 import org.xml.sax.helpers.AttributesImpl JavaDoc;
7
8 import org.xmlpull.v1.XmlPullParser;
9 import org.xmlpull.v1.XmlPullParserException;
10
11 /**
12  * Extensions of SAX2 Driver that provides a separate Attributes object
13  * for each startElement call so it is safe to keep the reference to Attributes.
14  *
15  * @author <a HREF="mailto:hkrug@rationalizer.com">Holger Krug</a>
16  */

17 public class AttributesCachingDriver extends Driver
18 {
19     public AttributesCachingDriver() throws XmlPullParserException {
20         super();
21     }
22
23     public AttributesCachingDriver(XmlPullParser pp) throws XmlPullParserException {
24         super(pp);
25     }
26
27     /**
28      * Calls {@link ContentHandler.startElement(String, String,
29      * String, Attributes) startElement} on the
30      * <code>ContentHandler</code> with copied attribute values. The
31      * {@link Attributes} object is may be stored.
32      */

33     protected void startElement(String JavaDoc namespace, String JavaDoc localName, String JavaDoc qName) throws SAXException JavaDoc {
34         contentHandler.startElement(namespace, localName, qName, new AttributesImpl JavaDoc(this));
35     }
36
37 }
38
39
40
41
Popular Tags