org.mmbase.datatypes
Class NodeDataType

java.lang.Object
  extended byorg.mmbase.core.AbstractDescriptor
      extended byorg.mmbase.datatypes.BasicDataType
          extended byorg.mmbase.datatypes.NodeDataType
All Implemented Interfaces:
Cloneable, Comparable, DataType, Descriptor, Serializable

public class NodeDataType
extends BasicDataType

The Node data type describes a data type which is based on an MMBase 'node' field. So the value is an MMBase node, which can normally be described by a foreign key.

Since:
MMBase-1.8
Version:
$Id: NodeDataType.java,v 1.28 2006/04/27 16:02:18 michiel Exp $
Author:
Pierre van Rooden, Michiel Meeuwissen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.mmbase.datatypes.BasicDataType
BasicDataType.AbstractRestriction, BasicDataType.EnumerationRestriction, BasicDataType.RequiredRestriction, BasicDataType.RestrictedEnumerationIterator, BasicDataType.StaticAbstractRestriction, BasicDataType.TypeRestriction, BasicDataType.UniqueRestriction
 
Nested classes inherited from class org.mmbase.datatypes.DataType
DataType.Restriction
 
Field Summary
protected  org.mmbase.datatypes.NodeDataType.MustExistRestriction mustExistRestriction
           
 
Fields inherited from class org.mmbase.datatypes.BasicDataType
DATATYPE_BUNDLE, 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, PROCESS_GET, PROCESS_SET, VALID, XMLNS
 
Constructor Summary
NodeDataType(String name)
          Constructor for node field.
 
Method Summary
protected  Object castToValidate(Object value, Node node, Field field)
          Before validating the value, the value will be 'casted', on default this will be to the 'correct' type, but it can be a more generic type sometimes.
protected  void cloneRestrictions(BasicDataType origin)
          If a datatype is cloned, the restrictions of it (normally implemented as inner classes), must be reinstantiated.
 org.mmbase.datatypes.NodeDataType.MustExistRestriction getMustExistRestriction()
           
protected  void inheritRestrictions(BasicDataType origin)
          If a datatype inherits from another datatype all its restrictions inherit too.
 boolean mustExist()
          Whether the Node of the value must exist XXX MM: How can you have a non-existing node? I don't really get it.
protected  Collection validateCastedValue(Collection errors, Object castedValue, Object value, Node node, Field field)
           
 
Methods inherited from class org.mmbase.datatypes.BasicDataType
cast, cast, checkType, clone, clone, compareTo, edit, equals, finish, finish, getBaseType, getBaseTypeIdentifier, getCloud, getCommitProcessor, getDefaultValue, getElement, getElement, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, getOrigin, getProcessor, getProcessor, getRequiredRestriction, getTypeAsClass, getUniqueRestriction, hashCode, inherit, inheritProperties, isCorrectType, isFinished, isRequired, isUnique, preCast, preCast, preCast, rewrite, setCommitProcessor, setDefaultValue, setProcessor, setProcessor, setRequired, setUnique, setXml, toString, toStringBuffer, toXml, toXml, validate, validate
 
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.bridge.Descriptor
getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName
 

Field Detail

mustExistRestriction

protected org.mmbase.datatypes.NodeDataType.MustExistRestriction mustExistRestriction
Constructor Detail

NodeDataType

public NodeDataType(String name)
Constructor for node 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 BasicDataType

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 BasicDataType

castToValidate

protected Object castToValidate(Object value,
                                Node node,
                                Field field)
                         throws CastException
Description copied from class: BasicDataType
Before validating the value, the value will be 'casted', on default this will be to the 'correct' type, but it can be a more generic type sometimes. E.g. for numbers this wil simply cast to Number.

Overrides:
castToValidate in class BasicDataType
Throws:
CastException

mustExist

public boolean mustExist()
Whether the Node of the value must exist XXX MM: How can you have a non-existing node? I don't really get it. AFAIK all nodes exist. especially since a node field is essentially a foreign key.


getMustExistRestriction

public org.mmbase.datatypes.NodeDataType.MustExistRestriction getMustExistRestriction()

validateCastedValue

protected Collection validateCastedValue(Collection errors,
                                         Object castedValue,
                                         Object value,
                                         Node node,
                                         Field field)
Overrides:
validateCastedValue in class BasicDataType


MMBase build 1.8.1.20060716