1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.config.spring.parsers.collection; |
8 | |
|
9 | |
import org.mule.config.spring.parsers.generic.ChildDefinitionParser; |
10 | |
|
11 | |
public class ChildMapEntryDefinitionParser extends ChildDefinitionParser |
12 | |
{ |
13 | |
|
14 | |
public static final String KEY = "key"; |
15 | |
public static final String VALUE = "value"; |
16 | |
|
17 | |
public ChildMapEntryDefinitionParser(String mapName) |
18 | |
{ |
19 | 0 | super(mapName, KeyValuePair.class); |
20 | 0 | } |
21 | |
|
22 | |
public ChildMapEntryDefinitionParser(String mapName, String keyName, String valueName) |
23 | |
{ |
24 | 0 | this(mapName); |
25 | 0 | addAlias(keyName, KEY); |
26 | 0 | addAlias(valueName, VALUE); |
27 | 0 | } |
28 | |
|
29 | |
public static class KeyValuePair |
30 | |
{ |
31 | |
private String key; |
32 | |
private Object value; |
33 | |
|
34 | |
public KeyValuePair() |
35 | |
{ |
36 | 0 | super(); |
37 | 0 | } |
38 | |
|
39 | |
public KeyValuePair(String key, Object value) |
40 | 0 | { |
41 | 0 | this.key = key; |
42 | 0 | this.value = value; |
43 | 0 | } |
44 | |
|
45 | |
public String getKey() |
46 | |
{ |
47 | 0 | return key; |
48 | |
} |
49 | |
|
50 | |
public Object getValue() |
51 | |
{ |
52 | 0 | return value; |
53 | |
} |
54 | |
|
55 | |
public void setKey(String key) |
56 | |
{ |
57 | 0 | this.key = key; |
58 | 0 | } |
59 | |
|
60 | |
public void setValue(Object value) |
61 | |
{ |
62 | 0 | this.value = value; |
63 | 0 | } |
64 | |
|
65 | |
} |
66 | |
} |