Revision 3102,
1.0 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 | |
---|
1 | package nu.fw.jeti.jabber.handlers; |
---|
2 | |
---|
3 | import java.net.MalformedURLException; |
---|
4 | import java.net.URL; |
---|
5 | |
---|
6 | import nu.fw.jeti.jabber.elements.Extension; |
---|
7 | import nu.fw.jeti.jabber.elements.IQXOOB; |
---|
8 | import nu.fw.jeti.util.I18N; |
---|
9 | |
---|
10 | import org.xml.sax.Attributes; |
---|
11 | |
---|
12 | /** |
---|
13 | * Created on 1-mrt-2003 |
---|
14 | * @author E.S. de Boer |
---|
15 | * |
---|
16 | */ |
---|
17 | public 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.