1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.serializer.objects;
18
19 import javolution.xml.*;
20 import javolution.xml.stream.XMLStreamException;
21
22 import org.apache.commons.lang.StringEscapeUtils;
23
24 public class JSGroup
25 {
26
27
28 String name;
29
30 public JSGroup()
31 {
32
33 }
34
35 /****************************************************************************
36 * SERIALIZER
37 */
38 private static final XMLFormat XML = new XMLFormat(JSGroup.class)
39 {
40 public void write(Object o, OutputElement xml) throws XMLStreamException
41 {
42
43 try
44 {
45 JSGroup g = (JSGroup) o;
46 xml.addText(g.getName());
47 } catch (Exception e)
48 {
49 e.printStackTrace();
50 }
51 }
52
53 public void read(InputElement xml, Object o)
54 {
55 try
56 {
57 JSGroup g = (JSGroup) o;
58 g.setName(StringEscapeUtils.unescapeHtml(xml.getText().toString()));
59 } catch (Exception e)
60 {
61 e.printStackTrace();
62 }
63 }
64 };
65 /***
66 * @return Returns the name.
67 */
68 public String getName()
69 {
70 return name;
71 }
72
73 /***
74 * @param name
75 * The name to set.
76 */
77 public void setName(String name)
78 {
79 this.name = name;
80 }
81
82 }