KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.xb.binding;
23
24 import org.xml.sax.ContentHandler JavaDoc;
25 import org.xml.sax.Locator JavaDoc;
26 import org.xml.sax.SAXException JavaDoc;
27 import org.xml.sax.Attributes JavaDoc;
28
29 /**
30  * org.xml.sax.ContentHandler implementation that poplulates an instance of org.jboss.xb.binding.Content.
31  *
32  * @author <a HREF="mailto:alex@jboss.org">Alexey Loubyansky</a>
33  * @version <tt>$Revision: 1958 $</tt>
34  */

35 public class ContentPopulator
36    implements ContentHandler JavaDoc
37 {
38    private Content content = new Content();
39
40    // Public
41

42    public Content getContent()
43    {
44       return content;
45    }
46
47    // ContentHandler implementation
48

49    public void setDocumentLocator(Locator JavaDoc locator)
50    {
51    }
52
53    public void startDocument()
54       throws SAXException JavaDoc
55    {
56       content.startDocument();
57    }
58
59    public void endDocument()
60       throws SAXException JavaDoc
61    {
62       content.endDocument();
63    }
64
65    public void startPrefixMapping(String JavaDoc prefix, String JavaDoc uri)
66       throws SAXException JavaDoc
67    {
68       content.startPrefixMapping(prefix, uri);
69    }
70
71    public void endPrefixMapping(String JavaDoc prefix)
72       throws SAXException JavaDoc
73    {
74       content.endPrefixMapping(prefix);
75    }
76
77    public void startElement(String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc qName, Attributes JavaDoc atts)
78       throws SAXException JavaDoc
79    {
80       content.startElement(namespaceURI, localName, qName, atts);
81    }
82
83    public void endElement(String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc qName)
84       throws SAXException JavaDoc
85    {
86       content.endElement(namespaceURI, localName, qName);
87    }
88
89    public void characters(char ch[], int start, int length)
90       throws SAXException JavaDoc
91    {
92       content.characters(ch, start, length);
93    }
94
95    public void ignorableWhitespace(char ch[], int start, int length)
96       throws SAXException JavaDoc
97    {
98    }
99
100    public void processingInstruction(String JavaDoc target, String JavaDoc data)
101       throws SAXException JavaDoc
102    {
103    }
104
105    public void skippedEntity(String JavaDoc name)
106       throws SAXException JavaDoc
107    {
108    }
109 }
Popular Tags