Subversion Repositories XServices

Rev

Rev 13 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13 Rev 22
Line 20... Line 20...
20
import java.util.Map;
20
import java.util.Map;
21
import javax.xml.bind.annotation.XmlElement;
21
import javax.xml.bind.annotation.XmlElement;
22
import javax.xml.bind.annotation.XmlRootElement;
22
import javax.xml.bind.annotation.XmlRootElement;
Line 23... Line 23...
23
 
23
 
-
 
24
/**
24
/**
25
 * Generic key/ value pairs.
25
 *
26
 *
26
 * @author brian
27
 * @author Brian Rosenberger
27
 */
28
 */
28
@XmlRootElement
29
@XmlRootElement
Line -... Line 30...
-
 
30
public class AntProperty {
-
 
31
 
-
 
32
    /**
29
public class AntProperty {
33
     * Key of the entry.
30
 
34
     */
Line -... Line 35...
-
 
35
    @XmlElement(required=true)
-
 
36
    public String name ="";
-
 
37
 
31
    @XmlElement(required=true)
38
    /**
32
    public String name ="";
39
     * Value of the entry.
Line -... Line 40...
-
 
40
     */
-
 
41
    @XmlElement(required=true)
-
 
42
    public String value="";
-
 
43
 
-
 
44
    /**
-
 
45
     * Converts a Map<String, String> into a list of
33
 
46
     * AntProperties.
34
    @XmlElement(required=true)
47
     * @param map   The map to convert
35
    public String value="";
48
     * @return      A list of key/value pairs
36
 
49
     */
37
    public static List<AntProperty> createAntPropertyList(Map<String, String> map) {
50
    public static List<AntProperty> createAntPropertyList(Map<String, String> map) {
38
        List<AntProperty> list = new ArrayList<AntProperty>();
51
        List<AntProperty> list = new ArrayList<AntProperty>();
39
        for(Map.Entry<String, String> e : map.entrySet()) {
52
        for(Map.Entry<String, String> e : map.entrySet()) {
Line -... Line 53...
-
 
53
            list.add(new AntProperty(e.getKey(), e.getValue()));
-
 
54
        }
-
 
55
        return list;
-
 
56
    }
-
 
57
 
40
            list.add(new AntProperty(e.getKey(), e.getValue()));
58
    /**
41
        }
59
     * Creates a new AntProperty.
42
        return list;
60
     * @param name
43
    }
61
     * @param value
Line -... Line 62...
-
 
62
     */
-
 
63
    public AntProperty(String name, String value) {
-
 
64
        this.name = name;
44
 
65
        this.value = value;
45
    public AntProperty(String name, String value) {
66
    }
Line 46... Line 67...
46
        this.name = name;
67