View Javadoc

1   /*
2    * $Id: ChildMapEntryDefinitionParser.java 12259 2008-07-09 14:18:28Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
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          super(mapName, KeyValuePair.class);
24      }
25  
26      public ChildMapEntryDefinitionParser(String mapName, String keyName, String valueName)
27      {
28          this(mapName);
29          addAlias(keyName, KEY);
30          addAlias(valueName, VALUE);
31      }
32  
33      public static class KeyValuePair
34      {
35          private String key;
36          private Object value;
37  
38          public KeyValuePair()
39          {
40              super();
41          }
42  
43          public KeyValuePair(String key, Object value)
44          {
45              this.key = key;
46              this.value = value;
47          }
48  
49          public String getKey()
50          {
51              return key;
52          }
53  
54          public Object getValue()
55          {
56              return value;
57          }
58  
59          public void setKey(String key)
60          {
61              this.key = key;
62          }
63  
64          public void setValue(Object value)
65          {
66              this.value = value;
67          }
68  
69      }
70  }