org.mmbase.core
Class AbstractDescriptor

java.lang.Object
  extended by org.mmbase.core.AbstractDescriptor
All Implemented Interfaces:
Cloneable, Descriptor, PublicCloneable<AbstractDescriptor>
Direct Known Subclasses:
AbstractField, BasicDataType, Parameter

public abstract class AbstractDescriptor
extends Object
implements Descriptor, PublicCloneable<AbstractDescriptor>

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

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
 AbstractDescriptor clone()
           
 AbstractDescriptor clone(String name)
           
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)
           
 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 which must be used if no locale is specified. The default implementation returns LocalizedString.getDefault() 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

getName

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

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)

setLocalizedGUIName

protected void setLocalizedGUIName(LocalizedString value)

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

toString

public String toString()
Overrides:
toString in class Object

clone

public AbstractDescriptor clone()
Specified by:
clone in interface PublicCloneable<AbstractDescriptor>
Overrides:
clone in class Object

clone

public AbstractDescriptor clone(String name)


MMBase 2.0-SNAPSHOT - null