KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.util.Collections JavaDoc;
22
23
24 /**
25  * @author <a HREF="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
26  */

27 public class Converter
28 {
29
30     private String JavaDoc converterId;
31     private String JavaDoc forClass;
32     private String JavaDoc converterClass;
33     private List JavaDoc _properties = null;
34     private List JavaDoc _attributes = null;
35
36
37     public String JavaDoc getConverterId()
38     {
39         return converterId;
40     }
41
42
43     public void setConverterId(String JavaDoc converterId)
44     {
45         this.converterId = converterId;
46     }
47
48
49     public String JavaDoc getForClass()
50     {
51         return forClass;
52     }
53
54
55     public void setForClass(String JavaDoc forClass)
56     {
57         this.forClass = forClass;
58     }
59
60
61     public String JavaDoc getConverterClass()
62     {
63         return converterClass;
64     }
65
66
67     public void setConverterClass(String JavaDoc converterClass)
68     {
69         this.converterClass = converterClass;
70     }
71
72     public void addProperty(Property value)
73     {
74         if(_properties==null)
75             _properties = new ArrayList JavaDoc();
76
77         _properties.add(value);
78     }
79
80     public Iterator JavaDoc getProperties()
81     {
82         if(_properties==null)
83             return Collections.EMPTY_LIST.iterator();
84
85         return _properties.iterator();
86     }
87     
88     public void addAttribute(Attribute value)
89     {
90         if(_attributes == null)
91             _attributes = new ArrayList JavaDoc();
92
93         _attributes.add(value);
94     }
95
96     public Iterator JavaDoc getAttributes()
97     {
98         if(_attributes==null)
99             return Collections.EMPTY_LIST.iterator();
100
101         return _attributes.iterator();
102     }
103 }
104
Popular Tags