1
2
3
4
5
6
7
8 package net.kwfgrid.gworkflowdl.structure;
9
10 import org.jdom.Element;
11
12 import java.util.Iterator;
13 import java.util.List;
14
15 /***
16 * User: hans
17 * Date: 28.03.2006
18 * Time: 13:40:34
19 */
20 public class OwlsJdom {
21 public static void java2element(Owls ho, Element e) {
22 String[] os = ho.getOwls();
23
24 for (String o : os) {
25 final Element oe = new Element("owl", JdomString.wfSpace);
26
27 oe.setText(o);
28 e.addContent(oe);
29 }
30 }
31
32 public static void element2java(Element e, Owls ho) {
33
34 List list = e.getChildren("owl", JdomString.wfSpace);
35
36
37 for (Object aList : list) {
38 final Element oe = (Element) aList;
39 ho.addOwl(oe.getText());
40 }
41 }
42
43
44
45 public static void java2ocElement(Owls ho, Element e) {
46 String[] os = ho.getOwls();
47
48 for (String o : os) {
49 final Element oe = new Element("owl", JdomString.ocSpace);
50
51 oe.setText(o);
52 e.addContent(oe);
53 }
54 }
55
56 public static void ocElement2java(Element e, Owls ho) {
57
58 List list = e.getChildren("owl", JdomString.ocSpace);
59
60
61 for (Object aList : list) {
62 final Element oe = (Element) aList;
63 ho.addOwl(oe.getText());
64 }
65 }
66 }