KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > xml > binding > ContentPopulator


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.xml.binding;
8
9 import org.xml.sax.ContentHandler JavaDoc;
10 import org.xml.sax.Locator JavaDoc;
11 import org.xml.sax.SAXException JavaDoc;
12 import org.xml.sax.Attributes JavaDoc;
13
14 /**
15  * org.xml.sax.ContentHandler implementation that poplulates an instance of org.jboss.xml.binding.Content.
16  *
17  * @author <a HREF="mailto:alex@jboss.org">Alexey Loubyansky</a>
18  * @version <tt>$Revision: 1.5.2.6 $</tt>
19  */

20 public class ContentPopulator
21    implements ContentHandler JavaDoc
22 {
23    private Content content = new Content();
24
25    // Public
26

27    public Content getContent()
28    {
29       return content;
30    }
31
32    // ContentHandler implementation
33

34    public void setDocumentLocator(Locator JavaDoc locator)
35    {
36    }
37
38    public void startDocument()
39       throws SAXException JavaDoc
40    {
41       content.startDocument();
42    }
43
44    public void endDocument()
45       throws SAXException JavaDoc
46    {
47       content.endDocument();
48    }
49
50    public void startPrefixMapping(String JavaDoc prefix, String JavaDoc uri)
51       throws SAXException JavaDoc
52    {
53       content.startPrefixMapping(prefix, uri);
54    }
55
56    public void endPrefixMapping(String JavaDoc prefix)
57       throws SAXException JavaDoc
58    {
59       content.endPrefixMapping(prefix);
60    }
61
62    public void startElement(String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc qName, Attributes JavaDoc atts)
63       throws SAXException JavaDoc
64    {
65       content.startElement(namespaceURI, localName, qName, atts);
66    }
67
68    public void endElement(String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc qName)
69       throws SAXException JavaDoc
70    {
71       content.endElement(namespaceURI, localName, qName);
72    }
73
74    public void characters(char ch[], int start, int length)
75       throws SAXException JavaDoc
76    {
77       content.characters(ch, start, length);
78    }
79
80    public void ignorableWhitespace(char ch[], int start, int length)
81       throws SAXException JavaDoc
82    {
83    }
84
85    public void processingInstruction(String JavaDoc target, String JavaDoc data)
86       throws SAXException JavaDoc
87    {
88    }
89
90    public void skippedEntity(String JavaDoc name)
91       throws SAXException JavaDoc
92    {
93    }
94 }
Popular Tags