KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * Copyright 2004 by Irian Marinschek & Spiegl Software OEG
3  */

4 package org.apache.myfaces.config.impl.digester.elements;
5
6 import java.util.List JavaDoc;
7 import java.util.ArrayList JavaDoc;
8 import java.util.Iterator JavaDoc;
9 import java.util.Collections JavaDoc;
10
11 /**
12  * @author Martin Marinschek
13  * @version $Revision: 1.1 $ $Date: 2005/03/04 00:28:45 $
14  *
15      The "property" element represents a JavaBean property of the Java class
16      represented by our parent element.
17
18      Property names must be unique within the scope of the Java class
19      that is represented by the parent element, and must correspond to
20      property names that will be recognized when performing introspection
21      against that class via java.beans.Introspector.
22
23     <!ELEMENT property (description*, display-name*, icon*, property-name, property-class, default-value?, suggested-value?, property-extension*)>
24
25  * <p/>
26  * $Log: Property.java,v $
27  * Revision 1.1 2005/03/04 00:28:45 mmarinschek
28  * Changes in configuration due to missing Attribute/Property classes for the converter; not building in the functionality yet except for part of the converter properties
29  *
30  */

31 public class Property
32 {
33     private List JavaDoc _description;
34     private List JavaDoc _displayName;
35     private List JavaDoc _icon;
36     private String JavaDoc _propertyName;
37     private String JavaDoc _propertyClass;
38     private String JavaDoc _defaultValue;
39     private String JavaDoc _suggestedValue;
40     private List JavaDoc _propertyExtension;
41
42
43     public void addDescription(String JavaDoc value)
44     {
45         if(_description == null)
46             _description = new ArrayList JavaDoc();
47
48         _description.add(value);
49     }
50
51     public Iterator JavaDoc getDescriptions()
52     {
53         if(_description==null)
54             return Collections.EMPTY_LIST.iterator();
55
56         return _description.iterator();
57     }
58
59     public void addDisplayName(String JavaDoc value)
60     {
61         if(_displayName == null)
62             _displayName = new ArrayList JavaDoc();
63
64         _displayName.add(value);
65     }
66
67     public Iterator JavaDoc getDisplayNames()
68     {
69         if(_displayName==null)
70             return Collections.EMPTY_LIST.iterator();
71
72         return _displayName.iterator();
73     }
74
75     public void addIcon(String JavaDoc value)
76     {
77         if(_icon == null)
78             _icon = new ArrayList JavaDoc();
79
80         _icon.add(value);
81     }
82
83     public Iterator JavaDoc getIcons()
84     {
85         if(_icon==null)
86             return Collections.EMPTY_LIST.iterator();
87
88         return _icon.iterator();
89     }
90
91     public void setPropertyName(String JavaDoc propertyName)
92     {
93         _propertyName = propertyName;
94     }
95
96     public String JavaDoc getPropertyName()
97     {
98         return _propertyName;
99     }
100
101     public void setPropertyClass(String JavaDoc propertyClass)
102     {
103         _propertyClass = propertyClass;
104     }
105
106     public String JavaDoc getPropertyClass()
107     {
108         return _propertyClass;
109     }
110
111     public void setDefaultValue(String JavaDoc defaultValue)
112     {
113         _defaultValue = defaultValue;
114     }
115
116     public String JavaDoc getDefaultValue()
117     {
118         return _defaultValue;
119     }
120
121     public void setSuggestedValue(String JavaDoc suggestedValue)
122     {
123         _suggestedValue = suggestedValue;
124     }
125
126     public String JavaDoc getSuggestedValue()
127     {
128         return _suggestedValue;
129     }
130
131     public void addPropertyExtension(String JavaDoc propertyExtension)
132     {
133         if(_propertyExtension == null)
134             _propertyExtension = new ArrayList JavaDoc();
135
136         _propertyExtension.add(propertyExtension);
137     }
138
139     public Iterator JavaDoc getPropertyExtensions()
140     {
141         if(_propertyExtension==null)
142             return Collections.EMPTY_LIST.iterator();
143
144         return _propertyExtension.iterator();
145     }
146
147 }
148
Popular Tags