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