Skip to content

Method: XStreamCreator()

1: package networkconfigurator.xstream;
2:
3: import java.util.List;
4:
5: import com.thoughtworks.xstream.XStream;
6:
7: import networkconfigurator.item.Item;
8:
9: /**
10: *
11: * @author HFW416 Jannik
12: *
13: */
14: public class XStreamCreator {
15:
16:         /**
17:          * the XStream instance.
18:          */
19:         private final XStream xstream = new XStream();
20:
21:         /**
22:          * serialize the object to XML string.
23:          *
24:          * @param itemList
25:          * that should be serialize.
26:          *
27:          * @return XML string.
28:          */
29:         public String serializeXml(final List<Item> itemList) {
30:                 return xstream.toXML(itemList);
31:         }
32:
33: }