public abstract class BaseDateTimeDt extends BasePrimitive<Date>
| Constructor and Description |
|---|
BaseDateTimeDt()
Constructor
|
BaseDateTimeDt(Date theDate,
TemporalPrecisionEnum thePrecision)
Constructor
|
BaseDateTimeDt(Date theDate,
TemporalPrecisionEnum thePrecision,
TimeZone theTimeZone)
Constructor
|
BaseDateTimeDt(String theString)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
encode(Date theValue)
Subclasses must override to convert a "coerced" value into an encoded one.
|
protected abstract TemporalPrecisionEnum |
getDefaultPrecisionForDatatype()
Returns the default precision for the given datatype
|
TemporalPrecisionEnum |
getPrecision()
Gets the precision for this datatype (using the default for the given type if not set)
|
TimeZone |
getTimeZone()
Returns the TimeZone associated with this dateTime's value.
|
boolean |
isTimeZoneZulu() |
boolean |
isToday()
Returns
true if this object represents a date that is today's date |
protected Date |
parse(String theValue)
Subclasses must override to convert an encoded representation of this datatype into a "coerced" one
|
void |
setPrecision(TemporalPrecisionEnum thePrecision)
Sets the precision for this datatype
|
BaseDateTimeDt |
setTimeZone(TimeZone theTimeZone) |
BaseDateTimeDt |
setTimeZoneZulu(boolean theTimeZoneZulu) |
BaseDateTimeDt |
setValue(Date theValue)
Sets the value for this type using the given Java Date object as the time, and using the default precision for this datatype, as well as the local timezone as determined by the local operating
system.
|
void |
setValue(Date theValue,
TemporalPrecisionEnum thePrecision)
Sets the value for this type using the given Java Date object as the time, and using the specified precision, as well as the local timezone as determined by the local operating system.
|
void |
setValueAsString(String theValue) |
String |
toHumanDisplay()
Returns a human readable version of this date/time using the system local format.
|
String |
toHumanDisplayLocalTimezone()
Returns a human readable version of this date/time using the system local format, converted to the local timezone if neccesary.
|
equals, getValue, getValueAsString, hashCode, isEmpty, readExternal, toString, updateStringValue, writeExternalgetElementSpecificId, getId, setElementSpecificId, setId, setIdaddUndeclaredExtension, addUndeclaredExtension, addUndeclaredExtension, getAllUndeclaredExtensions, getUndeclaredExtensions, getUndeclaredExtensionsByUrl, getUndeclaredModifierExtensions, isBaseEmptypublic BaseDateTimeDt()
public BaseDateTimeDt(Date theDate, TemporalPrecisionEnum thePrecision)
DataFormatException - If the specified precision is not allowed for this typepublic BaseDateTimeDt(String theString)
DataFormatException - If the specified precision is not allowed for this typepublic BaseDateTimeDt(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimeZone)
public String toHumanDisplay()
Note on time zones: This method renders the value using the time zone that is contained within the value. For example, if this date object contains the value "2012-01-05T12:00:00-08:00",
the human display will be rendered as "12:00:00" even if the application is being executed on a system in a different time zone. If this behaviour is not what you want, use
toHumanDisplayLocalTimezone() instead.
public String toHumanDisplayLocalTimezone()
protected String encode(Date theValue)
BasePrimitiveencode in class BasePrimitive<Date>theValue - Will not be nullprotected abstract TemporalPrecisionEnum getDefaultPrecisionForDatatype()
public TemporalPrecisionEnum getPrecision()
setPrecision(TemporalPrecisionEnum)public TimeZone getTimeZone()
null if no timezone was supplied.public boolean isTimeZoneZulu()
public boolean isToday()
true if this object represents a date that is today's dateNullPointerException - if BasePrimitive.getValue() returns nullprotected Date parse(String theValue) throws DataFormatException
BasePrimitiveparse in class BasePrimitive<Date>theValue - Will not be nullDataFormatExceptionpublic void setPrecision(TemporalPrecisionEnum thePrecision) throws DataFormatException
DataFormatExceptionpublic BaseDateTimeDt setTimeZone(TimeZone theTimeZone)
public BaseDateTimeDt setTimeZoneZulu(boolean theTimeZoneZulu)
public BaseDateTimeDt setValue(Date theValue)
setValue in interface IPrimitiveDatatype<Date>setValue in interface IPrimitiveType<Date>setValue in class BasePrimitive<Date>public void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws DataFormatException
theValue - The date valuethePrecision - The precisionDataFormatExceptionpublic void setValueAsString(String theValue) throws DataFormatException
setValueAsString in interface IPrimitiveDatatype<Date>setValueAsString in interface IPrimitiveType<Date>setValueAsString in class BasePrimitive<Date>DataFormatExceptionCopyright © 2014–2016 University Health Network. All rights reserved.