001: /*
002:
003: This software is OSI Certified Open Source Software.
004: OSI Certified is a certification mark of the Open Source Initiative.
005:
006: The license (Mozilla version 1.0) can be read at the MMBase site.
007: See http://www.MMBase.org/license
008:
009: */
010: package org.mmbase.bridge;
011:
012: import org.mmbase.util.LocalizedString;
013: import java.util.*;
014:
015: /**
016: * XXX A descriptor does not describe. It has descriptions. Perhaps 'UserPresentable'?
017: * @since MMBase-1.8
018: */
019: public interface Descriptor {
020:
021: /**
022: * Returns the name or 'key' of this object, or <code>null</code> if not applicable.
023: * @return the name as a String
024: */
025: public String getName();
026:
027: // XXX mm
028: // 5 methods for one property
029: // I propose to replace it with one:
030: // LocalizedString getGUIName(); (or perhaps for backwards compatibliy with Field getLocalizedGUIName)
031: // That was the point of LocalizedString.
032:
033: /**
034: * Returns the GUI name for this object.
035: *
036: * @return the GUI name for this object
037: */
038: public String getGUIName();
039:
040: /**
041: * Returns the GUI name for this object in a specified preferred language.
042: *
043: * @param locale the locale that determines the language for the GUI name
044: * @return the GUI name for this object
045: * @since MMBase-1.7
046: */
047: public String getGUIName(Locale locale);
048:
049: /**
050: * Returns the set of (localized) gui names of this object.
051: * @return the description as a LocalizedString
052: */
053: public LocalizedString getLocalizedGUIName();
054:
055: /**
056: * Sets the GUI name of this object.
057: * @param locale The locale for which this is valid, or <code>null</code> for the default locale.
058: * @param g the description as a String
059: */
060: public void setGUIName(String g, Locale locale);
061:
062: /**
063: * Sets the GUI name of this object for the default locale.
064: * @param g the description as a String
065: */
066: public void setGUIName(String g);
067:
068: // XXX mm:
069: /// 6 (!) methods just for one property!
070: // I would propose to replace this with one:
071: // LocalizedString getDescription() (or perhaps for backwards compatibliy with Field getLocalizedDescription)
072: // That was the whole point of LocalizedString.
073:
074: /**
075: * Returns the set of (localized) descriptions of this object.
076: * @return the description as a LocalizedString
077: */
078: public LocalizedString getLocalizedDescription();
079:
080: /**
081: * Returns the description of this object.
082: * @param locale The locale for which this must be returned, or <code>null</code> for a default locale.
083: * If no fitting description for the given locale is available, getName() can be returned.
084: * @return the description as a String
085: */
086: public String getDescription(Locale locale);
087:
088: /**
089: * Returns the description of this object for the default locale.
090: * @return the description as a String
091: */
092: public String getDescription();
093:
094: /**
095: * Sets the description of this object.
096: * @param description the description as a String
097: * @param locale The locale for which this is valid, or <code>null</code> for a default locale.
098: */
099: public void setDescription(String description, Locale locale);
100:
101: /**
102: * Sets the description of this object for the default locale.
103: * @param description the description as a String
104: */
105: public void setDescription(String description);
106:
107: }
|