Arch4J 1.1

org.arch4j.domain
Class DateTimeDomain

java.lang.Object
  |
  +--org.arch4j.domain.Domain
        |
        +--org.arch4j.domain.DateTimeDomain
All Implemented Interfaces:
Serializable

public abstract class DateTimeDomain
extends Domain

Represents a datetime value and provides convenience methods to set and retrieve the value in String format.

Version:
1.0
Author:
David Colwell
See Also:
Serialized Form

Field Summary
static String COMMON_DATE_FORMAT
          Constant defining the common date format.
static String COMMON_DATETIME_FORMAT
          Constant defining the common datetime format.
 
Constructor Summary
DateTimeDomain()
          Default constructor.
DateTimeDomain(Object aValue)
          Constructor which sets the domain's value to the specified argument.
 
Method Summary
 String getDate()
          Retrieves a String representation of this domain's Timestamp in date format.
 String getDateTime()
          Retrieves a String representation of this domain's Timestamp in datetime format.
protected  String getValueClass()
          The base class Domain will verify that any specified values are of this type or a subclass of this type.
 void setDate(String aDate)
          Sets this domain Timestamp value based on the specified date.
 void setDateTime(String aDateTime)
          Sets this domain Timestamp value based on the specified datetime.
 
Methods inherited from class org.arch4j.domain.Domain
getValue, setValue, toString, validate, validateType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMMON_DATE_FORMAT

public static final String COMMON_DATE_FORMAT
Constant defining the common date format.

See Also:
Constant Field Values

COMMON_DATETIME_FORMAT

public static final String COMMON_DATETIME_FORMAT
Constant defining the common datetime format.

See Also:
Constant Field Values
Constructor Detail

DateTimeDomain

public DateTimeDomain()
Default constructor. Ultimately, the base class, Domain, will set the domain's value to null.


DateTimeDomain

public DateTimeDomain(Object aValue)
               throws DomainValidationException
Constructor which sets the domain's value to the specified argument.

Method Detail

setDateTime

public void setDateTime(String aDateTime)
                 throws DomainValidationException
Sets this domain Timestamp value based on the specified datetime.

DomainValidationException

setDate

public void setDate(String aDate)
             throws DomainValidationException
Sets this domain Timestamp value based on the specified date.

DomainValidationException

getDateTime

public String getDateTime()
Retrieves a String representation of this domain's Timestamp in datetime format. If the Timestamp is null, then return an empty string.


getDate

public String getDate()
Retrieves a String representation of this domain's Timestamp in date format. If the Timestamp is null, then return an empty string.


getValueClass

protected String getValueClass()
The base class Domain will verify that any specified values are of this type or a subclass of this type.

Specified by:
getValueClass in class Domain
Returns:
the String representation of the Class type used by this domain value container.

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.