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