1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.marre.wap.nokia;
24
25 import java.io.IOException;
26
27 import org.marre.xml.XmlAttribute;
28 import org.marre.xml.XmlWriter;
29
30
31 public class NokiaOtaBookmark
32 {
33 protected String myName;
34 protected String myUrl;
35
36 /***
37 * Creates a Nokia Ota Browser Settings Bookmark
38 *
39 * @param name the name of the bookmark (max 50 chars)
40 * @param theUri the URI of the bookmark (max 255 chars)
41 */
42 public NokiaOtaBookmark(String name, String url)
43 {
44 myName = name;
45 myUrl = url;
46 }
47
48 public void writeXmlTo(XmlWriter xmlWriter) throws IOException
49 {
50
51 xmlWriter.addStartElement("CHARACTERISTIC", new XmlAttribute[]{new XmlAttribute("TYPE", "BOOKMARK")});
52
53
54 xmlWriter.addEmptyElement("PARM", new XmlAttribute[]{
55 new XmlAttribute("NAME", "NAME"),
56 new XmlAttribute("VALUE", myName)});
57
58 xmlWriter.addEmptyElement("PARM", new XmlAttribute[]{
59 new XmlAttribute("NAME", "URL"),
60 new XmlAttribute("VALUE", myUrl)});
61
62
63 xmlWriter.addEndElement();
64 }
65 }