- * 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 {@link #toHumanDisplayLocalTimezone()} - * instead. - *
- */ - public String toHumanDisplay() { - TimeZone tz = getTimeZone(); - Calendar value = tz != null ? Calendar.getInstance(tz) : Calendar.getInstance(); - value.setTime(getValue()); - - switch (getPrecision()) { - case YEAR: - case MONTH: - case DAY: - return ourHumanDateFormat.format(value); - case MILLI: - case SECOND: - default: - return ourHumanDateTimeFormat.format(value); - } - } - - /** - * Returns a human readable version of this date/time using the system local format, - * converted to the local timezone if neccesary. - * - * @see #toHumanDisplay() for a method which does not convert the time to the local - * timezone before rendering it. - */ - public String toHumanDisplayLocalTimezone() { - switch (getPrecision()) { - case YEAR: - case MONTH: - case DAY: - return ourHumanDateFormat.format(getValue()); - case MILLI: - case SECOND: - default: - return ourHumanDateTimeFormat.format(getValue()); - } - } + /** + * Returns a human readable version of this date/time using the system local format. + *+ * 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 + * {@link #toHumanDisplayLocalTimezone()} instead. + *
+ */ + public String toHumanDisplay() { + TimeZone tz = getTimeZone(); + Calendar value = tz != null ? Calendar.getInstance(tz) : Calendar.getInstance(); + value.setTime(getValue()); - /** + switch (getPrecision()) { + case YEAR: + case MONTH: + case DAY: + return ourHumanDateFormat.format(value); + case MILLI: + case SECOND: + default: + return ourHumanDateTimeFormat.format(value); + } + } + + /** + * Returns a human readable version of this date/time using the system local format, converted to the local timezone if neccesary. + * + * @see #toHumanDisplay() for a method which does not convert the time to the local timezone before rendering it. + */ + public String toHumanDisplayLocalTimezone() { + switch (getPrecision()) { + case YEAR: + case MONTH: + case DAY: + return ourHumanDateFormat.format(getValue()); + case MILLI: + case SECOND: + default: + return ourHumanDateTimeFormat.format(getValue()); + } + } + + /** * Constructor */ public BaseDateTimeDt() { @@ -147,7 +142,7 @@ public abstract class BaseDateTimeDt extends BasePrimitivenull
if no timezone was
- * supplied.
+ * Returns the TimeZone associated with this dateTime's value. May return null
if no timezone was supplied.
*/
public TimeZone getTimeZone() {
return myTimeZone;
@@ -279,7 +273,7 @@ public abstract class BaseDateTimeDt extends BasePrimitivetrue
if this object represents a date that is today's date
*
* @throws NullPointerException
- * if {@link #getValue()} returns null
+ * if {@link #getValue()} returns null
*/
public boolean isToday() {
Validate.notNull(getValue(), getClass().getSimpleName() + " contains null value");
@@ -417,10 +411,8 @@ public abstract class BaseDateTimeDt extends BasePrimitivenull
if this method is not resource
- * specific
+ * Returns the name of the resource this method handles, or null
if this method is not resource specific
*/
public abstract String getResourceName();
@@ -266,12 +266,9 @@ public abstract class BaseMethodBinding