org.openmrs.util
Class AttributableDate

java.lang.Object
  extended by java.util.Date
      extended by org.openmrs.util.AttributableDate
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<java.util.Date>, Attributable<AttributableDate>

public class AttributableDate
extends java.util.Date
implements Attributable<AttributableDate>

This class is a stand in for using "java.util.Date" as a PersonAttribute format. This will allow the end user to store a date as YYYY-MM-DD instead of storing it as a string in the date format of whatever user created the string

See Also:
Date, PersonAttribute, Attributable, Serialized Form

Constructor Summary
AttributableDate()
          Default empty constructor
AttributableDate(long time)
          Convenience constructor allowing creation of an AttributableDate with the given time
 
Method Summary
 java.util.List<AttributableDate> findPossibleValues(java.lang.String searchText)
          Search for possible values of this object using the given search string
 java.lang.String getDisplayString()
          Gets a descriptive String used for display purposes This is meant as an alternative to using the toString() to display this object to a user
 java.util.List<AttributableDate> getPossibleValues()
          Find all possible values of this object.
 AttributableDate hydrate(java.lang.String s)
          Deserialize the given string into a full object
 java.lang.String serialize()
          Turn the current object into an identifying string that can be retrieved later
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, equals, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, toString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributableDate

public AttributableDate()
Default empty constructor

See Also:
Date.Date()

AttributableDate

public AttributableDate(long time)
Convenience constructor allowing creation of an AttributableDate with the given time

Parameters:
time -
See Also:
Date.Date(long)
Method Detail

findPossibleValues

public java.util.List<AttributableDate> findPossibleValues(java.lang.String searchText)
Description copied from interface: Attributable
Search for possible values of this object using the given search string

Specified by:
findPossibleValues in interface Attributable<AttributableDate>
Parameters:
searchText - String to search on
Returns:
List of possible objects that can be assigned
See Also:
Attributable.findPossibleValues(java.lang.String)

getDisplayString

public java.lang.String getDisplayString()
Description copied from interface: Attributable
Gets a descriptive String used for display purposes This is meant as an alternative to using the toString() to display this object to a user

Specified by:
getDisplayString in interface Attributable<AttributableDate>
Returns:
String acceptable to display on a page
See Also:
Attributable.getDisplayString()

getPossibleValues

public java.util.List<AttributableDate> getPossibleValues()
Description copied from interface: Attributable
Find all possible values of this object. For example, if this object is a Location, the database is delved into and all Location objects should be returned

Specified by:
getPossibleValues in interface Attributable<AttributableDate>
Returns:
List of objects that can be assigned
See Also:
Attributable.getPossibleValues()

hydrate

public AttributableDate hydrate(java.lang.String s)
Description copied from interface: Attributable
Deserialize the given string into a full object

Specified by:
hydrate in interface Attributable<AttributableDate>
Parameters:
s - String to deserialize
Returns:
hydrated object
See Also:
Attributable.hydrate(java.lang.String)

serialize

public java.lang.String serialize()
Description copied from interface: Attributable
Turn the current object into an identifying string that can be retrieved later

Specified by:
serialize in interface Attributable<AttributableDate>
Returns:
String representing this object (Usually an identifier or primary key)
See Also:
Attributable.serialize()

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change