org.mmbase.datatypes
Class CheckEqualityDataType

java.lang.Object
  extended by org.mmbase.core.AbstractDescriptor
      extended by org.mmbase.datatypes.BasicDataType<E>
          extended by org.mmbase.datatypes.ComparableDataType<String>
              extended by org.mmbase.datatypes.StringDataType
                  extended by org.mmbase.datatypes.CheckEqualityDataType
All Implemented Interfaces:
Serializable, Cloneable, Comparable<DataType<String>>, Descriptor, DataType<String>, LengthDataType<String>, PublicCloneable<AbstractDescriptor>
Direct Known Subclasses:
ConfirmPasswordDataType

public class CheckEqualityDataType
extends StringDataType

A confirmed datatype must have the same value as another field of the node (and makes only sense as a field of a node).

Since:
MMBase-1.8
Version:
$Id: CheckEqualityDataType.java 35939 2009-06-10 13:42:19Z michiel $
Author:
Michiel Meeuwissen, Sander de Boer
See Also:
Serialized Form

Nested Class Summary
protected  class CheckEqualityDataType.FieldRestriction
           
 
Nested classes/interfaces inherited from class org.mmbase.datatypes.StringDataType
StringDataType.PatternRestriction
 
Nested classes/interfaces inherited from class org.mmbase.datatypes.ComparableDataType
ComparableDataType.MaxRestriction, ComparableDataType.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  CheckEqualityDataType.FieldRestriction fieldRestriction
           
 
Fields inherited from class org.mmbase.datatypes.StringDataType
BOOLEAN_PATTERN, DOUBLE_PATTERN, INTEGER_PATTERN, LONG_PATTERN, maxLengthRestriction, minLengthRestriction, NON_NEGATIVE_INTEGER_PATTERN, patternRestriction
 
Fields inherited from class org.mmbase.datatypes.ComparableDataType
maxRestriction, minRestriction
 
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
CheckEqualityDataType(String name)
          Constructor for string data type.
 
Method Summary
protected  void cloneRestrictions(BasicDataType origin)
          If a datatype is cloned, the restrictions of it (normally implemented as inner classes), must be reinstantiated.
 String getField()
          Returns the name of the field which is 'confirmed' by this datatype.
protected  String getFieldRestrictionName()
           
protected  void inheritRestrictions(BasicDataType origin)
          If a datatype inherits from another datatype all its restrictions inherit too.
 void setField(String field)
          The field property is the name of the other field that this fields 'confirms'.
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.StringDataType
castForPattern, clone, compare, first, getCollator, getComparator, getEnforceStrength, getLength, getMaxLength, getMaxLengthRestriction, getMinLength, getMinLengthRestriction, getPattern, getPatternRestriction, inheritProperties, isPassword, main, setCollator, setMaxLength, setMinLength, setPassword, setPattern, toXml, validateCastValueOrNull
 
Methods inherited from class org.mmbase.datatypes.ComparableDataType
getDefaultValue, getMaxRestriction, getMinRestriction, isMaxInclusive, isMinInclusive, setMax, setMin
 
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, getEnumerationValues, 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 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, 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

fieldRestriction

protected CheckEqualityDataType.FieldRestriction fieldRestriction
Constructor Detail

CheckEqualityDataType

public CheckEqualityDataType(String name)
Constructor for string data type.

Parameters:
name - the name of the data type
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 StringDataType

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 StringDataType

validateCastValue

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

setField

public void setField(String field)
The field property is the name of the other field that this fields 'confirms'. It default to ''. In datatype XML it can be set with the generic <property name="field" value="..." />


getField

public String getField()
Returns the name of the field which is 'confirmed' by this datatype.


toStringBuilder

protected StringBuilder toStringBuilder()
Overrides:
toStringBuilder in class StringDataType

getFieldRestrictionName

protected String getFieldRestrictionName()


MMBase 2.0-SNAPSHOT - null