View Javadoc

1   package org.lsst.ccs.localdb.statusdb.server;
2   
3   import java.util.ArrayList;
4   import java.util.Map;
5   import java.util.Map.Entry;
6   
7   import javax.xml.bind.annotation.XmlAttribute;
8   import javax.xml.bind.annotation.XmlRootElement;
9   
10  
11  @XmlRootElement(name="entry")
12  public class HashMapEntry4XML {
13  	@XmlAttribute String name;
14  	@XmlAttribute String value;
15  	public HashMapEntry4XML(String name, String value) {
16  		super();
17  		this.name = name;
18  		this.value = value;
19  	}
20  	
21  	public HashMapEntry4XML() {}
22  
23  	public static ArrayList<HashMapEntry4XML> marshal(Map<String, String> v)  {
24  		ArrayList<HashMapEntry4XML> res = new ArrayList<HashMapEntry4XML>();
25  		for (Entry<String, String> i : v.entrySet()) {
26  			res.add(new HashMapEntry4XML(i.getKey(), i.getValue()));
27  		}
28  
29  		return res;
30  	}
31  	
32  }