org.mmbase.datatypes
Class LanguageDataType
java.lang.Object
org.mmbase.core.AbstractDescriptor
org.mmbase.datatypes.BasicDataType<E>
org.mmbase.datatypes.ComparableDataType<String>
org.mmbase.datatypes.StringDataType
org.mmbase.datatypes.LanguageDataType
- All Implemented Interfaces:
- Serializable, Cloneable, Comparable<DataType<String>>, Descriptor, DataType<String>, LengthDataType<String>, PublicCloneable<AbstractDescriptor>
public class LanguageDataType
- extends StringDataType
Returns the current language as a default value. For the rest it is like StringDataType.
- Since:
- MMBase-1.9.1
- Version:
- $Id: LanguageDataType.java 42557 2010-06-15 09:18:45Z michiel $
- Author:
- Michiel Meeuwissen
- See Also:
- Serialized Form
|
Method Summary |
String |
getDefaultValue(Locale locale,
Cloud cloud,
Field field)
Returns the (locale dependent) default value of this data type, |
Iterator<Map.Entry<String,String>> |
getEnumerationValues(Locale locale,
Cloud cloud,
Node node,
Field field)
Returns an iterator over all possible values for this datatype, as Map.Entrys, or
null if no enumeration restrictions apply. |
protected static Locale |
getLocale(Cloud cloud,
Field field)
|
void |
setInSelf(boolean b)
If you set this to true, then the names of the languages are not presented in the current
locale, but in the language itself (if that is known by the JVM). |
| Methods inherited from class org.mmbase.datatypes.StringDataType |
castForPattern, clone, cloneRestrictions, compare, first, getCollator, getComparator, getEnforceStrength, getLength, getMaxLength, getMaxLengthRestriction, getMinLength, getMinLengthRestriction, getPattern, getPatternRestriction, inheritProperties, inheritRestrictions, isPassword, main, setCollator, setMaxLength, setMinLength, setPassword, setPattern, toStringBuilder, toXml, validateCastValue, validateCastValueOrNull |
| Methods inherited from class org.mmbase.datatypes.BasicDataType |
addErrorDescription, addRestriction, addRestriction, addStyleClass, cast, cast, castAndValidate, castForSearch, castOrException, castToPresent, castToValidate, checkType, clone, compareTo, edit, equals, finish, finish, getBaseType, getBaseTypeIdentifier, getCloud, getCloud, getCommitProcessor, getDefaultProcessor, getDefaultValue, getDeleteProcessor, getElement, getElement, getEnforceString, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getHandler, getHandlers, getOrigin, getProcessor, getProcessor, getProcessorWithoutDefault, getRequiredRestriction, getRestrictions, getStyleClasses, getTypeAsClass, getUniqueRestriction, hashCode, inherit, isCorrectType, isFinished, isRequired, isUnique, preCast, preCast, preCast, rewrite, setCommitProcessor, setDefaultProcessor, setDefaultValue, setDeleteProcessor, setProcessor, setProcessor, setRequired, setUnique, setXml, toString, toXml, validate, validate, validateRequired, xmlValue |
| Methods inherited from class org.mmbase.core.AbstractDescriptor |
getDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName |
| Methods inherited from interface org.mmbase.datatypes.DataType |
cast, castAndValidate, castForSearch, castOrException, checkType, clone, finish, getBaseType, getBaseTypeIdentifier, getCommitProcessor, getDefaultValue, getDeleteProcessor, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getHandler, getHandlers, getOrigin, getProcessor, getProcessor, getRequiredRestriction, getStyleClasses, getTypeAsClass, getUniqueRestriction, isFinished, isRequired, isUnique, preCast, rewrite, setCommitProcessor, setDefaultValue, setProcessor, setProcessor, setRequired, setUnique, toXml, validate, validate |
| Methods inherited from interface org.mmbase.bridge.Descriptor |
getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName |
languageInSelf
protected boolean languageInSelf
LanguageDataType
public LanguageDataType(String name)
setInSelf
public void setInSelf(boolean b)
- If you set this to true, then the names of the languages are not presented in the current
locale, but in the language itself (if that is known by the JVM).
- Since:
- MMBase-1.9.2
getLocale
protected static Locale getLocale(Cloud cloud,
Field field)
getEnumerationValues
public Iterator<Map.Entry<String,String>> getEnumerationValues(Locale locale,
Cloud cloud,
Node node,
Field field)
- Description copied from class:
BasicDataType
- Returns an iterator over all possible values for this datatype, as
Map.Entrys, or
null if no enumeration restrictions apply. Every Map entry contains as key the
'value' for this datatype and as value it contains the description for this value in the
given locale.
This Iterator skips all entries which are impossible because of other restrictions on this datatype.
- Specified by:
getEnumerationValues in interface DataType<String>- Overrides:
getEnumerationValues in class BasicDataType<String>
- Parameters:
locale - for which to producecloud - Possibly the possible values depend on a cloud (security)node - Possibly the possible values depend on an actual node (this may be, and in the default implementation is, ignored)field - Possibly the possible values depend on an actual field (this may be, and in the default implementation is, ignored)
- Returns:
- iterator over all possible values for this datatype
getDefaultValue
public String getDefaultValue(Locale locale,
Cloud cloud,
Field field)
- Description copied from class:
BasicDataType
- Returns the (locale dependent) default value of this data type,
- Specified by:
getDefaultValue in interface DataType<String>- Overrides:
getDefaultValue in class ComparableDataType<String>
MMBase 2.0-SNAPSHOT - null