KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > bridge > Descriptor


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.bridge;
11
12 import org.mmbase.util.LocalizedString;
13 import java.util.*;
14
15
16 /**
17  * XXX A descriptor does not describe. It has descriptions. Perhaps 'UserPresentable'?
18  * @since MMBase-1.8
19  */

20 public interface Descriptor {
21
22     /**
23      * Returns the name or 'key' of this object, or <code>null</code> if not applicable.
24      * @return the name as a String
25      */

26     public String JavaDoc getName();
27
28
29     // XXX mm
30
// 5 methods for one property
31
// I propose to replace it with one:
32
// LocalizedString getGUIName(); (or perhaps for backwards compatibliy with Field getLocalizedGUIName)
33
// That was the point of LocalizedString.
34

35     /**
36      * Returns the GUI name for this object.
37      *
38      * @return the GUI name for this object
39      */

40     public String JavaDoc getGUIName();
41
42    /**
43      * Returns the GUI name for this object in a specified preferred language.
44      *
45      * @param locale the locale that determines the language for the GUI name
46      * @return the GUI name for this object
47      * @since MMBase-1.7
48      */

49     public String JavaDoc getGUIName(Locale locale);
50
51     /**
52      * Returns the set of (localized) gui names of this object.
53      * @return the description as a LocalizedString
54      */

55     public LocalizedString getLocalizedGUIName();
56
57     /**
58      * Sets the GUI name of this object.
59      * @param locale The locale for which this is valid, or <code>null</code> for the default locale.
60      * @param g the description as a String
61      */

62     public void setGUIName(String JavaDoc g, Locale locale);
63
64     /**
65      * Sets the GUI name of this object for the default locale.
66      * @param g the description as a String
67      */

68     public void setGUIName(String JavaDoc g);
69
70
71     // XXX mm:
72
/// 6 (!) methods just for one property!
73
// I would propose to replace this with one:
74
// LocalizedString getDescription() (or perhaps for backwards compatibliy with Field getLocalizedDescription)
75
// That was the whole point of LocalizedString.
76

77     /**
78      * Returns the set of (localized) descriptions of this object.
79      * @return the description as a LocalizedString
80      */

81     public LocalizedString getLocalizedDescription();
82
83     /**
84      * Returns the description of this object.
85      * @param locale The locale for which this must be returned, or <code>null</code> for a default locale.
86      * If no fitting description for the given locale is available, getName() can be returned.
87      * @return the description as a String
88      */

89     public String JavaDoc getDescription(Locale locale);
90
91     /**
92      * Returns the description of this object for the default locale.
93      * @return the description as a String
94      */

95     public String JavaDoc getDescription();
96
97     /**
98      * Sets the description of this object.
99      * @param description the description as a String
100      * @param locale The locale for which this is valid, or <code>null</code> for a default locale.
101      */

102     public void setDescription(String JavaDoc description, Locale locale);
103
104     /**
105      * Sets the description of this object for the default locale.
106      * @param description the description as a String
107      */

108     public void setDescription(String JavaDoc description);
109
110
111 }
112
Popular Tags