org.mmbase.datatypes
Class DateTimeDataType
java.lang.Object
org.mmbase.core.AbstractDescriptor
org.mmbase.datatypes.BasicDataType
org.mmbase.datatypes.ComparableDataType
org.mmbase.datatypes.DateTimeDataType
- All Implemented Interfaces:
- Cloneable, Comparable, DataType, Descriptor, Serializable
- public class DateTimeDataType
- extends ComparableDataType
The date-time datatype further describes Date objects. The date can be
restricted to a certain period (using ComparableDataType.setMin(java.lang.Comparable, boolean), ComparableDataType.setMax(java.lang.Comparable, boolean), and Casting.toDate(java.lang.Object). The presentation logic can be specified using a pattern, see
getPattern().
- Since:
- MMBase-1.8
- Version:
- $Id: DateTimeDataType.java,v 1.33 2006/04/11 21:53:10 michiel Exp $
- Author:
- Pierre van Rooden, Michiel Meeuwissen
- See Also:
- Serialized Form
| Methods inherited from class org.mmbase.datatypes.ComparableDataType |
cloneRestrictions, getDefaultValue, getMaxRestriction, getMinRestriction, inheritRestrictions, isMaxInclusive, isMinInclusive, setMax, setMin, toXml, validateCastedValue |
| Methods inherited from class org.mmbase.datatypes.BasicDataType |
cast, cast, checkType, clone, compareTo, edit, equals, finish, finish, getBaseType, getBaseTypeIdentifier, getCloud, getCommitProcessor, getElement, getElement, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, getOrigin, getProcessor, getProcessor, getRequiredRestriction, getTypeAsClass, getUniqueRestriction, hashCode, inherit, isCorrectType, isFinished, isRequired, isUnique, preCast, preCast, preCast, rewrite, setCommitProcessor, setProcessor, setProcessor, setRequired, setUnique, setXml, toString, 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 interface org.mmbase.bridge.Descriptor |
getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName |
MIN_VALUE
public static final Date MIN_VALUE
MAX_VALUE
public static final Date MAX_VALUE
DateTimeDataType
public DateTimeDataType(String name)
- Constructor for DateTime field.
setDefaultValue
public void setDefaultValue(Object o)
- Description copied from class:
BasicDataType
-
- Specified by:
setDefaultValue in interface DataType- Overrides:
setDefaultValue in class BasicDataType
inheritProperties
protected void inheritProperties(BasicDataType origin)
- Description copied from class:
BasicDataType
- Properties are members of the datatype that can easily be copied/clones.
- Overrides:
inheritProperties 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
getMin
public Date getMin()
- Returns:
- the minimum value as an
Date, or very very long ago if there is no minimum.
getMax
public Date getMax()
- Returns:
- the maximum value as an
Date, or a very very in the future if there is no maximum.
getPattern
public DateTimePattern getPattern()
- The 'pattern' of a 'DateTime' value gives a
DateTimePattern object which can be used as an
indication for presentation.
Basicly, this can indicate whether the objects present e.g. only a date, only a time and whether e.g. this time includes seconds or not.
DateTimePattern is actually a wrapper arround a pattern, and that is used here.
setPattern
public void setPattern(String p,
Locale locale)
- Set the pattern for a certain Locale.
See also
getPattern().
clone
public Object clone(String name)
- Description copied from class:
BasicDataType
-
Besides super.clone, it calls
BasicDataType.inheritProperties(BasicDataType) and BasicDataType.cloneRestrictions(BasicDataType). A clone is not finished. See BasicDataType.isFinished().
- Specified by:
clone in interface DataType- Overrides:
clone in class ComparableDataType
toStringBuffer
protected StringBuffer toStringBuffer()
- Overrides:
toStringBuffer in class ComparableDataType
MMBase build 1.8.1.20060716