source: branches/2.2/jabberit_messenger/java_source/src/nu/fw/jeti/jabber/handlers/UnknownExtensionHandler.java @ 3102

Revision 3102, 1.6 KB checked in by amuller, 14 years ago (diff)

Ticket #986 - Efetuado merge para o Branch 2.2( atualizacao do modulo)

  • Property svn:executable set to *
Line 
1package nu.fw.jeti.jabber.handlers;
2
3import org.xml.sax.Attributes;
4
5import nu.fw.jeti.util.I18N;
6import nu.fw.jeti.util.Log;
7import nu.fw.jeti.jabber.elements.Extension;
8
9/**
10 * <p>Title: im</p>
11 * <p>Description: </p>
12 * <p>Copyright: Copyright (c) 2001</p>
13 * <p>Company: </p>
14 * @author E.S. de Boer
15 * @version 1.0
16 */
17
18public class UnknownExtensionHandler extends ExtensionHandler
19{
20        private StringBuffer xmlText = new StringBuffer();
21
22        public void startHandling(Attributes attr)
23        {
24                xmlText = new StringBuffer();
25                xmlText.append("<");
26                xmlText.append(getName());
27                if (attr != null) {
28                        String aName = null;
29                        for (int i = 0; i < attr.getLength(); i++) {
30                                aName = attr.getQName(i);
31                                xmlText.append(" ");
32                                xmlText.append(aName+"=\""+attr.getValue(i)+"\"");
33                        }
34                }
35                xmlText.append(">");
36        }
37
38        public void startElement(String name,Attributes attr)
39        {
40                xmlText.append("<");
41                xmlText.append(name);
42                if (attr != null) {
43                        String aName = null;
44                        for (int i = 0; i < attr.getLength(); i++) {
45                                aName = attr.getQName(i);
46                                xmlText.append(" ");
47                                xmlText.append(aName+"=\""+attr.getValue(i)+"\"");
48                        }
49                }
50                xmlText.append(">");
51        }
52
53        public void endElement(String name)
54        {
55                xmlText.append(getText());
56                xmlText.append("</");
57                xmlText.append(name);
58                xmlText.append(">");
59
60                clearCurrentChars();
61        }
62
63        public Extension build() throws InstantiationException
64        {
65                xmlText.append("</");
66                xmlText.append(getName());
67                xmlText.append(">");
68                Log.notParsedXML(xmlText.toString());
69                throw new InstantiationException(I18N.gettext("main.error.Unknown_Extension"));
70        }
71}
72/*
73 * Overrides for emacs
74 * Local variables:
75 * tab-width: 4
76 * End:
77 */
Note: See TracBrowser for help on using the repository browser.