org.mmbase.datatypes
Class ListDataType

java.lang.Object
  extended by org.mmbase.core.AbstractDescriptor
      extended by org.mmbase.datatypes.BasicDataType<E>
          extended by org.mmbase.datatypes.AbstractLengthDataType<List>
              extended by org.mmbase.datatypes.ListDataType
All Implemented Interfaces:
Serializable, Cloneable, Comparable<DataType<List>>, Descriptor, DataType<List>, LengthDataType<List>, PublicCloneable<AbstractDescriptor>

public class ListDataType
extends AbstractLengthDataType<List>

Since:
MMBase-1.8
Version:
$Id: ListDataType.java 41987 2010-04-20 16:14:35Z michiel $
Author:
Pierre van Rooden, Michiel Meeuwissen
See Also:
Serialized Form
Javadoc:

Nested Class Summary
protected  class ListDataType.ItemRestriction
           
 
Nested classes/interfaces inherited from class org.mmbase.datatypes.AbstractLengthDataType
AbstractLengthDataType.MaxRestriction, AbstractLengthDataType.MinRestriction
 
Nested classes/interfaces inherited from class org.mmbase.datatypes.BasicDataType
BasicDataType.AbstractRestriction<D extends Serializable>, BasicDataType.DataTypeComparator<D>, BasicDataType.EnumerationRestriction, BasicDataType.RequiredRestriction, BasicDataType.RestrictedEnumerationIterator, BasicDataType.StaticAbstractRestriction<D extends Serializable>, BasicDataType.TypeRestriction, BasicDataType.UniqueRestriction
 
Nested classes/interfaces inherited from interface org.mmbase.datatypes.DataType
DataType.Restriction<D extends Serializable>
 
Field Summary
protected  ListDataType.ItemRestriction itemRestriction
           
 
Fields inherited from class org.mmbase.datatypes.AbstractLengthDataType
maxLengthRestriction, minLengthRestriction
 
Fields inherited from class org.mmbase.datatypes.BasicDataType
DATATYPE_BUNDLE, defaultValue, enumerationRestriction, origin, requiredRestriction, typeRestriction, uniqueRestriction
 
Fields inherited from class org.mmbase.core.AbstractDescriptor
description, guiName, key
 
Fields inherited from interface org.mmbase.datatypes.DataType
ENFORCE_ABSOLUTE, ENFORCE_ALWAYS, ENFORCE_NEVER, ENFORCE_ONCHANGE, ENFORCE_ONCREATE, ENFORCE_ONVALIDATE, PROCESS_GET, PROCESS_SET, VALID, XMLNS
 
Constructor Summary
ListDataType(String name)
          Constructor for List field.
 
Method Summary
protected  void cloneRestrictions(BasicDataType origin)
          If a datatype is cloned, the restrictions of it (normally implemented as inner classes), must be reinstantiated.
 int getEnforceStrength()
          The maximum enforce strength of all restrictions on this datatype.
 DataType getItemDataType()
          Returns the datatype of items in this list.
 DataType.Restriction getItemDataTypeRestriction()
          Returns the 'itemDataType' restriction, containing the value, errormessages, and fixed status of this attribute.
 long getLength(Object value)
          In this method should be implemented how to calculate such a length for a certain value of this datatype.
protected  void inheritRestrictions(BasicDataType origin)
          If a datatype inherits from another datatype all its restrictions inherit too.
 void setItemDataType(DataType value)
          Sets the datatype of items in this list.
protected  StringBuilder toStringBuilder()
           
protected  Collection<LocalizedString> validateCastValue(Collection<LocalizedString> errors, Object castValue, Object value, Node node, Field field)
           
 
Methods inherited from class org.mmbase.datatypes.AbstractLengthDataType
getMaxLength, getMaxLengthRestriction, getMinLength, getMinLengthRestriction, setMaxLength, setMinLength, toXml, validateCastValueOrNull
 
Methods inherited from class org.mmbase.datatypes.BasicDataType
addErrorDescription, addRestriction, addRestriction, addStyleClass, cast, cast, castAndValidate, castForSearch, castOrException, castToPresent, castToValidate, checkType, clone, clone, compareTo, edit, equals, finish, finish, getBaseType, getBaseTypeIdentifier, getCloud, getCloud, getCommitProcessor, getComparator, getDefaultProcessor, getDefaultValue, getDefaultValue, getDeleteProcessor, getElement, getElement, getEnforceString, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, getHandler, getHandlers, getOrigin, getProcessor, getProcessor, getProcessorWithoutDefault, getRequiredRestriction, getRestrictions, getStyleClasses, getTypeAsClass, getUniqueRestriction, hashCode, inherit, inheritProperties, 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 class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.datatypes.DataType
cast, castAndValidate, castForSearch, castOrException, checkType, clone, clone, finish, getBaseType, getBaseTypeIdentifier, getCommitProcessor, getDefaultValue, getDefaultValue, getDeleteProcessor, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, 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
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

itemRestriction

protected ListDataType.ItemRestriction itemRestriction
Constructor Detail

ListDataType

public ListDataType(String name)
Constructor for List field.

Method Detail

inheritRestrictions

protected void inheritRestrictions(BasicDataType origin)
Description copied from class: BasicDataType
If a datatype inherits from another datatype all its restrictions inherit too.

Overrides:
inheritRestrictions in class AbstractLengthDataType<List>

cloneRestrictions

protected void cloneRestrictions(BasicDataType origin)
Description copied from class: BasicDataType
If a datatype is cloned, the restrictions of it (normally implemented as inner classes), must be reinstantiated.

Overrides:
cloneRestrictions in class AbstractLengthDataType<List>

getLength

public long getLength(Object value)
Description copied from class: AbstractLengthDataType
In this method should be implemented how to calculate such a length for a certain value of this datatype. There does not exist a generic interface for this, so the implementation will cast to the expected type (String, byte[]..)

Specified by:
getLength in interface LengthDataType<List>
Specified by:
getLength in class AbstractLengthDataType<List>

getItemDataType

public DataType getItemDataType()
Returns the datatype of items in this list.

Returns:
the datatype as a DataType object, null if there are no restrictions

getItemDataTypeRestriction

public DataType.Restriction getItemDataTypeRestriction()
Returns the 'itemDataType' restriction, containing the value, errormessages, and fixed status of this attribute.

Returns:
the restriction as a DataType.Restriction

setItemDataType

public void setItemDataType(DataType value)
Sets the datatype of items in this list.

Parameters:
value - the datatype as a DataType object, null if there are no restrictions

getEnforceStrength

public int getEnforceStrength()
Description copied from interface: DataType
The maximum enforce strength of all restrictions on this datatype. See DataType.ENFORCE_ALWAYS, DataType.ENFORCE_ONCHANGE, DataType.ENFORCE_NEVER.

Specified by:
getEnforceStrength in interface DataType<List>
Overrides:
getEnforceStrength in class AbstractLengthDataType<List>
Returns:
maximum enforce strength

validateCastValue

protected Collection<LocalizedString> validateCastValue(Collection<LocalizedString> errors,
                                                        Object castValue,
                                                        Object value,
                                                        Node node,
                                                        Field field)
Overrides:
validateCastValue in class AbstractLengthDataType<List>

toStringBuilder

protected StringBuilder toStringBuilder()
Overrides:
toStringBuilder in class AbstractLengthDataType<List>


MMBase 2.0-SNAPSHOT - null