1 | protected void set(String key, String value) {↵ | | 1 | public void set(String key, String value) {↵
|
2 | Element child = getParentElement().getChild(key);↵ | | 2 | Element child = getParentElement().getChild(key);↵
|
3 | if (child == null) {↵ | | 3 | if (child == null) {↵
|
4 | child = new Element(key);↵ | | 4 | child = new Element(key);↵
|
5 | getParentElement().addContent(child);↵ | | 5 | getParentElement().addContent(child);↵
|
6 | }↵ | | 6 | }↵
|
7 | child.setText(value);↵ | | 7 | child.setText(value);↵
|
8 | }↵ | | 8 | }↵
|
|
9 | /**↵ | | 9 | ↵
|
10 | * @see org.columba.calendar.model.api.IBasicModel#set(java.lang.String,↵ | | |
|
11 | * java.lang.String, java.lang.String)↵ | | |
|
12 | */↵ | | |
|
13 | protected void set(String key, String prefix, String value) {↵ | | 10 | public void set(String key, String prefix, String value) {↵
|
14 | Element child = getParentElement().getChild(key);↵ | | 11 | Element child = getParentElement().getChild(key);↵
|
15 | if (child == null) {↵ | | 12 | if (child == null) {↵
|
16 | child = new Element(key);↵ | | 13 | child = new Element(key);↵
|
17 | getParentElement().addContent(child);↵ | | 14 | getParentElement().addContent(child);↵
|
18 | }↵ | | 15 | }↵
|
19 | Element prefixchild = child.getChild(prefix);↵ | | 16 | Element prefixchild = child.getChild(prefix);↵
|
20 | if (prefixchild == null) {↵ | | 17 | if (prefixchild == null) {↵
|
21 | prefixchild = new Element(prefix);↵ | | 18 | prefixchild = new Element(prefix);↵
|
22 | child.addContent(prefixchild);↵ | | 19 | child.addContent(prefixchild);↵
|
23 | }↵ | | 20 | }↵
|
24 | prefixchild.setText(value);↵ | | 21 | prefixchild.setText(value);↵
|
25 | }↵ | | 22 | }↵
|
|
26 | /**↵ | | 23 | ↵
|
27 | * @see org.columba.calendar.model.api.IBasicModel#get(java.lang.String)↵ | | |
|
28 | */↵ | | |
|
29 | protected String get(String key) {↵ | | 24 | public String get(String key) {↵
|
30 | Element child = getParentElement().getChild(key);↵ | | 25 | Element child = getParentElement().getChild(key);↵
|
31 | if (child == null) {↵ | | 26 | if (child == null) {↵
|
32 | child = new Element(key);↵ | | 27 | child = new Element(key);↵
|
33 | getParentElement().addContent(child);↵ | | 28 | getParentElement().addContent(child);↵
|
34 | }↵ | | 29 | }↵
|
35 | return child.getTextNormalize();↵ | | 30 | return child.getTextNormalize();↵
|
36 | }↵ | | 31 | }↵
|
|
37 | /**↵ | | 32 | ↵
|
38 | * @see org.columba.calendar.model.api.IBasicModel#get(java.lang.String,↵ | | |
|
39 | * java.lang.String)↵ | | |
|
40 | */↵ | | |
|
41 | protected String get(String key, String prefix) {↵ | | 33 | public String get(String key, String prefix) {↵
|
42 | Element child = getParentElement().getChild(key);↵ | | 34 | Element child = getParentElement().getChild(key);↵
|
43 | if (child == null) {↵ | | 35 | if (child == null) {↵
|
44 | child = new Element(key);↵ | | 36 | child = new Element(key);↵
|
45 | getParentElement().addContent(child);↵ | | 37 | getParentElement().addContent(child);↵
|
46 | }↵ | | 38 | }↵
|
47 | Element prefixchild = child.getChild(prefix);↵ | | 39 | Element prefixchild = child.getChild(prefix);↵
|
48 | if (prefixchild == null) {↵ | | 40 | if (prefixchild == null) {↵
|
49 | prefixchild = new Element(prefix);↵ | | 41 | prefixchild = new Element(prefix);↵
|
50 | child.addContent(prefixchild);↵ | | 42 | child.addContent(prefixchild);↵
|
51 | }↵ | | 43 | }↵
|
|
52 | return prefixchild.getTextNormalize();↵ | | 44 | return prefixchild.getTextNormalize();↵
|
53 | }↵ | | 45 | }↵
|
|
54 | /**↵ | | |
|
55 | * @see org.columba.calendar.model.api.IBasicModel#getDocument()↵ | | |
|
56 | */↵ | | |
|
57 | public Document getDocument() {↵ | | 46 | public Document getDocument() {↵
|
58 | return doc;↵ | | 47 | return doc;↵
|
59 | }↵ | | 48 | }↵
|
|
60 | /**↵ | | 49 | /**↵
|
61 | * @return Returns the id.↵ | | 50 | * @return Returns the id.↵
|
62 | */↵ | | 51 | */↵
|
63 | public String getId() {↵ | | 52 | public String getId() {↵
|
64 | return get(ICALENDAR.UID);↵ | | 53 | return get(VCARD.ID);↵
|
65 | }↵ | | 54 | }↵
|
|
66 | public void setId(String id) {↵ | | 55 | public void setId(String id) {↵
|
67 | set(ICALENDAR.UID, id) | | 56 | set(VCARD.ID, id)
|