|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.core.AbstractDescriptor
org.mmbase.datatypes.BasicDataType<E>
org.mmbase.datatypes.ComparableDataType<Date>
org.mmbase.datatypes.DateTimeDataType
public class DateTimeDataType
The date-time datatype further describes 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().
| Nested Class Summary |
|---|
| 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 | |
|---|---|
static Date |
MAX_VALUE
|
static Date |
MIN_VALUE
|
| 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 | |
|---|---|
DateTimeDataType(String name)
Constructor for DateTime field. |
|
| Method Summary | |
|---|---|
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 |
first()
Returns a natural 'first' value. |
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)
|
| Methods inherited from class org.mmbase.datatypes.ComparableDataType |
|---|
cloneRestrictions, compare, getComparator, getDefaultValue, getEnforceStrength, getMaxRestriction, getMinRestriction, inheritRestrictions, isMaxInclusive, isMinInclusive, setMax, setMin, toXml, validateCastValue |
| 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 |
|---|
public static final Date MIN_VALUE
public static final Date MAX_VALUE
| Constructor Detail |
|---|
public DateTimeDataType(String name)
| Method Detail |
|---|
protected void xmlValue(Element el,
Object value)
xmlValue in class BasicDataType<Date>public void setDefaultValue(Object o)
BasicDataType
setDefaultValue in interface DataType<Date>setDefaultValue in class BasicDataType<Date>o - default valueprotected void inheritProperties(BasicDataType origin)
BasicDataType
inheritProperties in class BasicDataType<Date>
protected Object castToValidate(Object value,
Node node,
Field field)
throws CastException
BasicDataType
castToValidate 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().
clone in interface DataType<Date>clone in class ComparableDataType<Date>name - the new name of the copied datatype (can be null, in which case the name is not changed).
protected StringBuilder toStringBuilder()
toStringBuilder in class ComparableDataType<Date>public Date first()
ComparableDataType0
first in class ComparableDataType<Date>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||