source: 3thparty/jmessenger/src/nu/fw/jeti/jabber/handlers/IQXOOBHandler.java @ 3952

Revision 3952, 1.0 KB checked in by alexandrecorreia, 13 years ago (diff)

Ticket #1710 - Adicao do codigo fonte java do componente jmessenger(jabberit_messenger)

  • Property svn:executable set to *
Line 
1package nu.fw.jeti.jabber.handlers;
2
3import java.net.MalformedURLException;
4import java.net.URL;
5
6import nu.fw.jeti.jabber.elements.Extension;
7import nu.fw.jeti.jabber.elements.IQXOOB;
8import nu.fw.jeti.util.I18N;
9
10import org.xml.sax.Attributes;
11
12/**
13 * Created on 1-mrt-2003
14 * @author E.S. de Boer
15 *
16 */
17public class IQXOOBHandler extends ExtensionHandler
18{
19        private String url;
20        private String description;
21
22
23        public void startHandling(Attributes attr)
24        {
25                url = null;
26                description = null;
27        }
28
29        public void endElement(String name)
30        {
31                if (name.equals("url")) url = getText();
32                else if (name.equals("desc")) description  = getText();
33                else nu.fw.jeti.util.Log.notParsedXML("OOB" + name + getText());
34                clearCurrentChars();
35        }
36
37
38
39        public Extension build() throws InstantiationException
40        {
41                try
42                {
43                        return new IQXOOB(new URL(url),description);
44                }
45                catch (MalformedURLException e)
46                {
47                        throw new InstantiationException(I18N.gettext("main.error.invalid_url_in_OOB_packet"));
48                }
49        }
50
51       
52}
53
54/*
55 * Overrides for emacs
56 * Local variables:
57 * tab-width: 4
58 * End:
59 */
Note: See TracBrowser for help on using the repository browser.