public class DateTimeDataType extends ComparableDataType<Date>
Date objects. The date can be
restricted to a certain period (using ComparableDataType.setMin(E, boolean), ComparableDataType.setMax(E, boolean), and Casting.toDate(java.lang.Object). The presentation logic can be specified using a pattern, see
getPattern().ComparableDataType.MaxRestriction, ComparableDataType.MinRestrictionBasicDataType.AbstractRestriction<D extends Serializable>, BasicDataType.DataTypeComparator<D>, BasicDataType.EnumerationRestriction, BasicDataType.RequiredRestriction, BasicDataType.RestrictedEnumerationIterator, BasicDataType.StaticAbstractRestriction<D extends Serializable>, BasicDataType.TypeRestriction, BasicDataType.UniqueRestrictionDataType.Restriction<D extends Serializable>| Modifier and Type | Field and Description |
|---|---|
static Date |
MAX_VALUE |
static Date |
MIN_VALUE |
maxRestriction, minRestrictionDATATYPE_BUNDLE, defaultValue, enumerationRestriction, origin, requiredRestriction, typeRestriction, uniqueRestrictiondescription, guiName, keyENFORCE_ABSOLUTE, ENFORCE_ALWAYS, ENFORCE_NEVER, ENFORCE_ONCHANGE, ENFORCE_ONCREATE, ENFORCE_ONVALIDATE, PROCESS_GET, PROCESS_SET, VALID, XMLNS| Constructor and Description |
|---|
DateTimeDataType(String name)
Constructor for DateTime field.
|
| Modifier and Type | Method and Description |
|---|---|
protected Object |
castToValidate(Object value,
Node node,
Field field)
Before validating the value, the value will be 'cast', on default this will be to the
'correct' type, but it can be a more generic type sometimes.
|
DateTimeDataType |
clone(String name)
Returns a cloned instance of this datatype, inheriting all validation rules.
|
Date |
getMax() |
Date |
getMin() |
DateTimePattern |
getPattern()
The 'pattern' of a 'DateTime' value gives a
DateTimePattern object which can be used as an
indication for presentation. |
TimeZone |
getTimeZone()
A timezone can be attributed.
|
protected void |
inheritProperties(BasicDataType origin)
Properties are members of the datatype that can easily be copied/clones.
|
void |
setDefaultValue(Object o)
Set the default value for this DataType
|
void |
setPattern(String p,
Locale locale)
Set the pattern for a certain Locale.
|
void |
setTimeZone(TimeZone tz)
You can assign a time zone to the datatype.
|
protected StringBuilder |
toStringBuilder() |
protected void |
xmlValue(Element el,
Object value) |
cloneRestrictions, compare, getComparator, getDefaultValue, getEnforceStrength, getMaxRestriction, getMinRestriction, inheritRestrictions, isMaxInclusive, isMinInclusive, setMax, setMin, toXml, validateCastValueaddErrorDescription, addRestriction, addRestriction, addStyleClass, cast, cast, castAndValidate, castForSearch, castToPresent, 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, setDeleteProcessor, setProcessor, setProcessor, setRequired, setUnique, setXml, toString, toXml, validate, validate, validateCastValueOrNull, validateRequiredgetDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUINamefinalize, getClass, notify, notifyAll, wait, wait, waitgetDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUINamepublic static final Date MIN_VALUE
public static final Date MAX_VALUE
public DateTimeDataType(String name)
protected void xmlValue(Element el, Object value)
xmlValue in class BasicDataType<Date>public void setDefaultValue(Object o)
BasicDataTypesetDefaultValue in interface DataType<Date>setDefaultValue in class BasicDataType<Date>o - default valueprotected void inheritProperties(BasicDataType origin)
BasicDataTypeinheritProperties in class BasicDataType<Date>protected Object castToValidate(Object value, Node node, Field field) throws CastException
BasicDataTypecastToValidate in class BasicDataType<Date>CastExceptionpublic Date getMin()
Date, or very very long ago if there is no minimum.public Date getMax()
Date, or a date very very far in the future if there is no maximum.public DateTimePattern getPattern()
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.public void setPattern(String p, Locale locale)
getPattern().public void setTimeZone(TimeZone tz)
getTimeZone(). Normally the timezone is provided by the client, but
sometimes the timezone can be an intrinsic part of the datatype.public TimeZone getTimeZone()
null (default)public DateTimeDataType clone(String name)
BasicDataTypeBasicDataType.inheritProperties(BasicDataType) and BasicDataType.cloneRestrictions(BasicDataType). A clone is not finished. See BasicDataType.isFinished().protected StringBuilder toStringBuilder()
toStringBuilder in class ComparableDataType<Date>MMBase 1.9-SNAPSHOT - ${javadoctimestamp}