View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.config.impl.digester.elements;
20  
21  import java.io.Serializable;
22  import java.util.ArrayList;
23  import java.util.List;
24  import java.util.Iterator;
25  
26  
27  /**
28   * @author <a href="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
29   */
30  public class MapEntriesImpl extends org.apache.myfaces.config.element.MapEntries implements Serializable
31  {
32  
33      private String keyClass;
34      private String valueClass;
35      private List<org.apache.myfaces.config.element.MapEntry> entries
36              = new ArrayList<org.apache.myfaces.config.element.MapEntry>();
37  
38  
39      public String getKeyClass()
40      {
41          return keyClass;
42      }
43  
44  
45      public void setKeyClass(String keyClass)
46      {
47          this.keyClass = keyClass;
48      }
49  
50  
51      public String getValueClass()
52      {
53          return valueClass;
54      }
55  
56  
57      public void setValueClass(String valueClass)
58      {
59          this.valueClass = valueClass;
60      }
61  
62      public void addEntry(Entry entry)
63      {
64          entries.add(entry);
65      }
66  
67  
68      public Iterator<org.apache.myfaces.config.element.MapEntry> getMapEntries()
69      {
70          return entries.iterator();
71      }
72  
73  
74      public static class Entry extends org.apache.myfaces.config.element.MapEntry
75      {
76         String key;
77          boolean nullValue = false;
78          String value;
79  
80  
81          public String getKey()
82          {
83              return key;
84          }
85  
86  
87          public void setKey(String key)
88          {
89              this.key = key;
90          }
91  
92  
93          public boolean isNullValue()
94          {
95              return nullValue;
96          }
97  
98  
99          public void setNullValue()
100         {
101             this.nullValue = true;
102         }
103 
104 
105         public String getValue()
106         {
107             return value;
108         }
109 
110 
111         public void setValue(String value)
112         {
113             this.value = value;
114         }
115     }
116 }