org.mmbase.core
Class AbstractDescriptor

java.lang.Object
  extended byorg.mmbase.core.AbstractDescriptor
All Implemented Interfaces:
Cloneable, Descriptor
Direct Known Subclasses:
AbstractField, BasicDataType, Parameter

public abstract class AbstractDescriptor
extends Object
implements Descriptor, Cloneable

Since:
MMBase-1.8
Version:
$Id: AbstractDescriptor.java,v 1.8 2006/06/26 11:45:50 michiel Exp $
Author:
Pierre van Rooden
Warning: No Java Documentation Available.

Field Summary
protected  LocalizedString description
           
protected  LocalizedString guiName
           
protected  String key
           
 
Constructor Summary
protected AbstractDescriptor()
           
protected AbstractDescriptor(String name)
          Create a data type object
protected AbstractDescriptor(String name, Descriptor descriptor)
           
protected AbstractDescriptor(String name, Descriptor descriptor, boolean cloneDataForRewrite)
          Create a data type object
 
Method Summary
 Object clone()
           
 Object clone(String name)
           
protected  Locale getDefaultLocale()
          The locale wihch 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 data type.
 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)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

key

protected String key

description

protected LocalizedString description

guiName

protected LocalizedString guiName
Constructor Detail

AbstractDescriptor

protected AbstractDescriptor()

AbstractDescriptor

protected AbstractDescriptor(String name)
Create a data type object

Parameters:
name - the name of the data type

AbstractDescriptor

protected AbstractDescriptor(String name,
                             Descriptor descriptor,
                             boolean cloneDataForRewrite)
Create a data type object

Parameters:
name - the name of the data type
descriptor -

AbstractDescriptor

protected AbstractDescriptor(String name,
                             Descriptor descriptor)
Method Detail

getDefaultLocale

protected Locale getDefaultLocale()
The locale wihch must be used if no locale is specified . Returns null for the defaul of this. This method can be overriden if another more logical default is available. E.g. in BasicField, where the locale of the current cloud is returned here.

Since:
MMBase-1.8.1

getName

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

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

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:
locale - The locale for which this is valid, or null for the default locale.
g - the description as a String

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)

toString

public String toString()

clone

public Object clone()
             throws CloneNotSupportedException
Throws:
CloneNotSupportedException

clone

public Object clone(String name)
             throws CloneNotSupportedException
Throws:
CloneNotSupportedException


MMBase build 1.8.1.20060716