KickJava   Java API By Example, From Geeks To Geeks.

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


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 "attribute" element represents a named, typed, value associated with
16      the parent UIComponent via the generic attributes mechanism.
17
18      Attribute names must be unique within the scope of the parent (or related)
19      component.
20
21      <!ELEMENT attribute (description*, display-name*, icon*, attribute-name, attribute-class, default-value?, suggested-value?, attribute-extension*)>
22  
23  * <p/>
24  * $Log: Attribute.java,v $
25  * Revision 1.1 2005/03/04 00:28:45 mmarinschek
26  * 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
27  *
28  *
29  */

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