org.mmbase.util.functions
Class DescribedFunctionProvider

java.lang.Object
  extended by org.mmbase.util.functions.FunctionProvider
      extended by org.mmbase.util.functions.DescribedFunctionProvider
All Implemented Interfaces:
Descriptor
Direct Known Subclasses:
Module

public abstract class DescribedFunctionProvider
extends FunctionProvider
implements Descriptor

A described function provider maintains a set of Function objects, and also contains functionality to add gui information to the provider itself.

Since:
MMBase-1.9
Version:
$Id: DescribedFunctionProvider.java 41943 2010-04-16 17:18:19Z michiel $
Author:
Pierre van Rooden

Field Summary
protected  LocalizedString description
          Descriptions per locale
protected  LocalizedString guiName
          (GUI) names per locale
protected  String name
          Name or key of the provider.
 
Fields inherited from class org.mmbase.util.functions.FunctionProvider
functions, getFunctions
 
Constructor Summary
protected DescribedFunctionProvider()
           
protected DescribedFunctionProvider(String name)
          Create a described function provider
 
Method Summary
protected  Locale getDefaultLocale()
          The locale which must be used if no locale is specified.
 String getDescription()
          Returns the description of this object for the default locale.
 String getDescription(Locale locale)
          Returns the description of this object.
 String getGUIName()
          Retrieve the GUI name of the field.
 String getGUIName(Locale locale)
          Retrieve the GUI name of the field depending on specified langauge.
 LocalizedString getLocalizedDescription()
          Returns the set of (localized) descriptions of this object.
 LocalizedString getLocalizedGUIName()
          Returns the set of (localized) gui names of this object.
 String getName()
          Returns the name or 'key' of this descriptor.
 void setDescription(String desc)
          Sets the description of this object for the default locale.
 void setDescription(String desc, Locale locale)
          Sets the description of this object.
 void setGUIName(String g)
          Sets the GUI name of this object for the default locale.
 void setGUIName(String g, Locale locale)
          Sets the GUI name of this object.
protected  void setLocalizedDescription(LocalizedString description)
           
protected  void setLocalizedGUIName(LocalizedString value)
           
 void setName(String n)
          Deprecated.  
 
Methods inherited from class org.mmbase.util.functions.FunctionProvider
addFunction, createParameters, getFunction, getFunctions, getFunctionValue, newFunctionInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name
Name or key of the provider.


description

protected LocalizedString description
Descriptions per locale


guiName

protected LocalizedString guiName
(GUI) names per locale

Constructor Detail

DescribedFunctionProvider

protected DescribedFunctionProvider()

DescribedFunctionProvider

protected DescribedFunctionProvider(String name)
Create a described function provider

Parameters:
name - the name of the function provider
Method Detail

getName

public String getName()
Returns the name or 'key' of this descriptor.

Specified by:
getName in interface Descriptor
Returns:
the name as a String

setName

public final void setName(String n)
Deprecated. 


getDefaultLocale

protected Locale getDefaultLocale()
The locale which must be used if no locale is specified. The default implementation returns null. This method can be overriden if another more logical default is available. E.g. in BasicField the locale of the current cloud is returned.

Since:
MMBase-1.8.1

getDescription

public String getDescription(Locale locale)
Description copied from interface: Descriptor
Returns the description of this object.

Specified by:
getDescription in interface Descriptor
Parameters:
locale - The locale for which this must be returned, or null for a default locale. If no fitting description for the given locale is available, getName() can be returned.
Returns:
the description as a String

getDescription

public String getDescription()
Description copied from interface: Descriptor
Returns the description of this object for the default locale.

Specified by:
getDescription in interface Descriptor
Returns:
the description as a String

getLocalizedDescription

public LocalizedString getLocalizedDescription()
Description copied from interface: Descriptor
Returns the set of (localized) descriptions of this object.

Specified by:
getLocalizedDescription in interface Descriptor
Returns:
the description as a LocalizedString

setLocalizedDescription

protected void setLocalizedDescription(LocalizedString description)

setDescription

public void setDescription(String desc,
                           Locale locale)
Description copied from interface: Descriptor
Sets the description of this object.

Specified by:
setDescription in interface Descriptor
Parameters:
desc - the description as a String
locale - The locale for which this is valid, or null for a default locale.

setDescription

public void setDescription(String desc)
Description copied from interface: Descriptor
Sets the description of this object for the default locale.

Specified by:
setDescription in interface Descriptor
Parameters:
desc - the description as a String

getGUIName

public String getGUIName(Locale locale)
Retrieve the GUI name of the field depending on specified langauge. If the language is not available, the "en" value is returned instead. If that one is unavailable the internal fieldname is returned.

Specified by:
getGUIName in interface Descriptor
Parameters:
locale - the locale that determines the language for the GUI name
Returns:
the GUI Name

getGUIName

public String getGUIName()
Retrieve the GUI name of the field. If possible, the "en" value is returned. If that one is unavailable the internal fieldname is returned.

Specified by:
getGUIName in interface Descriptor
Returns:
the GUI Name

setGUIName

public void setGUIName(String g,
                       Locale locale)
Description copied from interface: Descriptor
Sets the GUI name of this object.

Specified by:
setGUIName in interface Descriptor
Parameters:
g - the description as a String
locale - The locale for which this is valid, or null for the default locale.

setGUIName

public void setGUIName(String g)
Description copied from interface: Descriptor
Sets the GUI name of this object for the default locale.

Specified by:
setGUIName in interface Descriptor
Parameters:
g - the description as a String

getLocalizedGUIName

public LocalizedString getLocalizedGUIName()
Description copied from interface: Descriptor
Returns the set of (localized) gui names of this object.

Specified by:
getLocalizedGUIName in interface Descriptor
Returns:
the description as a LocalizedString

setLocalizedGUIName

protected void setLocalizedGUIName(LocalizedString value)


MMBase 2.0-SNAPSHOT - null