KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > config > impl > digester > elements > MapEntries


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.config.impl.digester.elements;
17
18 import java.util.ArrayList JavaDoc;
19 import java.util.List JavaDoc;
20 import java.util.Iterator JavaDoc;
21
22
23 /**
24  * @author <a HREF="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
25  */

26 public class MapEntries implements org.apache.myfaces.config.element.MapEntries
27 {
28
29     private String JavaDoc keyClass;
30     private String JavaDoc valueClass;
31     private List JavaDoc entries = new ArrayList JavaDoc();
32
33
34     public String JavaDoc getKeyClass()
35     {
36         return keyClass;
37     }
38
39
40     public void setKeyClass(String JavaDoc keyClass)
41     {
42         this.keyClass = keyClass;
43     }
44
45
46     public String JavaDoc getValueClass()
47     {
48         return valueClass;
49     }
50
51
52     public void setValueClass(String JavaDoc valueClass)
53     {
54         this.valueClass = valueClass;
55     }
56
57     public void addEntry(Entry entry) {
58         entries.add(entry);
59     }
60
61
62     public Iterator JavaDoc getMapEntries()
63     {
64         return entries.iterator();
65     }
66
67
68     public static class Entry implements org.apache.myfaces.config.element.MapEntry {
69        String JavaDoc key;
70         boolean nullValue = false;
71         String JavaDoc value;
72
73
74         public String JavaDoc getKey()
75         {
76             return key;
77         }
78
79
80         public void setKey(String JavaDoc key)
81         {
82             this.key = key;
83         }
84
85
86         public boolean isNullValue()
87         {
88             return nullValue;
89         }
90
91
92         public void setNullValue()
93         {
94             this.nullValue = true;
95         }
96
97
98         public String JavaDoc getValue()
99         {
100             return value;
101         }
102
103
104         public void setValue(String JavaDoc value)
105         {
106             this.value = value;
107         }
108     }
109 }
110
Popular Tags