01: /*
02: * $Id: ChildMapEntryDefinitionParser.java 10256 2008-01-08 15:20:25Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
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
16: ChildDefinitionParser {
17:
18: public static final String KEY = "key";
19: public static final String VALUE = "value";
20:
21: public ChildMapEntryDefinitionParser(String mapName) {
22: super (mapName, KeyValuePair.class);
23: }
24:
25: public ChildMapEntryDefinitionParser(String mapName,
26: String keyName, String valueName) {
27: this (mapName);
28: addAlias(keyName, KEY);
29: addAlias(valueName, VALUE);
30: }
31:
32: public static class KeyValuePair {
33: private String key;
34: private Object value;
35:
36: public KeyValuePair() {
37: }
38:
39: public KeyValuePair(String key, Object value) {
40: this .key = key;
41: this .value = value;
42: }
43:
44: public String getKey() {
45: return key;
46: }
47:
48: public Object getValue() {
49: return value;
50: }
51:
52: public void setKey(String key) {
53: this .key = key;
54: }
55:
56: public void setValue(Object value) {
57: this.value = value;
58: }
59:
60: }
61: }
|