org.mmbase.datatypes
Class BooleanDataType

java.lang.Object
  extended by org.mmbase.core.AbstractDescriptor
      extended by org.mmbase.datatypes.BasicDataType<Boolean>
          extended by org.mmbase.datatypes.BooleanDataType
All Implemented Interfaces:
Serializable, Cloneable, Comparable<DataType<Boolean>>, Descriptor, DataType<Boolean>, PublicCloneable<AbstractDescriptor>

public class BooleanDataType
extends BasicDataType<Boolean>

The DataType associated with a boolean value.

Since:
MMBase-1.8
Version:
$Id: BooleanDataType.java 35587 2009-06-02 21:57:49Z michiel $
Author:
Pierre van Rooden
See Also:
Serialized Form

Nested Class Summary
 
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
 
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
BooleanDataType(String name, boolean primitive)
          Constructor for a boolean datatype (either a primitive boolean type or the Boolean class).
 
Method Summary
protected  Boolean cast(Object value, Cloud cloud, Node node, Field field)
          Cast a bit more conservatively, because Casting aggressively casts everything to boolean, which would make nearly every value valid.
protected
<D> D
preCast(D value, Cloud cloud, Node node, Field field)
          This method implements 'precasting', which can be seen as a kind of datatype specific casting.
 
Methods inherited from class org.mmbase.datatypes.BasicDataType
addErrorDescription, addRestriction, addRestriction, addStyleClass, cast, castAndValidate, castForSearch, castOrException, castToPresent, castToValidate, checkType, clone, clone, cloneRestrictions, compareTo, edit, equals, finish, finish, getBaseType, getBaseTypeIdentifier, getCloud, getCloud, getCommitProcessor, getComparator, getDefaultProcessor, getDefaultValue, getDefaultValue, getDeleteProcessor, getElement, getElement, getEnforceStrength, getEnforceString, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, getHandler, getHandlers, getOrigin, getProcessor, getProcessor, getProcessorWithoutDefault, getRequiredRestriction, getRestrictions, getStyleClasses, getTypeAsClass, getUniqueRestriction, hashCode, inherit, inheritProperties, inheritRestrictions, isCorrectType, isFinished, isRequired, isUnique, preCast, preCast, rewrite, setCommitProcessor, setDefaultProcessor, setDefaultValue, setDeleteProcessor, setProcessor, setProcessor, setRequired, setUnique, setXml, toString, toStringBuilder, toXml, toXml, validate, validate, validateCastValue, validateCastValueOrNull, 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.bridge.Descriptor
getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName
 

Constructor Detail

BooleanDataType

public BooleanDataType(String name,
                       boolean primitive)
Constructor for a boolean datatype (either a primitive boolean type or the Boolean class).

Parameters:
name - the name of the data type
primitive - indicate if a primitive type should be used
Method Detail

preCast

protected <D> D preCast(D value,
                        Cloud cloud,
                        Node node,
                        Field field)
Description copied from class: BasicDataType
This method implements 'precasting', which can be seen as a kind of datatype specific casting. It should anticipate that every argument can be null. It should not change the actual type of the value.

Overrides:
preCast in class BasicDataType<Boolean>

cast

protected final Boolean cast(Object value,
                             Cloud cloud,
                             Node node,
                             Field field)
                      throws CastException
Cast a bit more conservatively, because Casting aggressively casts everything to boolean, which would make nearly every value valid.

Overrides:
cast in class BasicDataType<Boolean>
Throws:
CastException


MMBase 2.0-SNAPSHOT - null