org.kuali.rice.krad.web.bind
Class UifDateEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by org.kuali.rice.krad.web.bind.UifDateEditor
All Implemented Interfaces:
PropertyEditor
Direct Known Subclasses:
UifDateViewTimestampEditor

public class UifDateEditor
extends PropertyEditorSupport

This PropertyEditor converts between date display strings and java.sql.Date objects.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
private  DateTimeService dateTimeService
          The date time service.
 
Constructor Summary
UifDateEditor()
           
 
Method Summary
protected  Object convertToObject(String text)
          Convert display text to java.sql.Date object using the org.kuali.rice.core.api.datetime.DateTimeService.
 String getAsText()
          This overridden method uses the org.kuali.rice.core.api.datetime.DateTimeService to convert the date object to the display string.
protected  DateTimeService getDateTimeService()
          Gets the date time service.
 void setAsText(String text)
          This overridden method converts the display string to a java.sql.Date object using the org.kuali.rice.core.api.datetime.DateTimeService.
private  String verbatimYear(String date)
          For a given user input date, this method returns the exact string the user entered after the last slash.
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dateTimeService

private transient DateTimeService dateTimeService
The date time service.

Constructor Detail

UifDateEditor

public UifDateEditor()
Method Detail

getAsText

public String getAsText()
This overridden method uses the org.kuali.rice.core.api.datetime.DateTimeService to convert the date object to the display string.

Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
See Also:
PropertyEditorSupport.getAsText()

getDateTimeService

protected DateTimeService getDateTimeService()
Gets the date time service.

Returns:
the date time service

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
This overridden method converts the display string to a java.sql.Date object using the org.kuali.rice.core.api.datetime.DateTimeService.

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException
See Also:
PropertyEditorSupport.setAsText(java.lang.String)

convertToObject

protected Object convertToObject(String text)
                          throws IllegalArgumentException
Convert display text to java.sql.Date object using the org.kuali.rice.core.api.datetime.DateTimeService.

Parameters:
text - the display text
Returns:
the java.sql.Date object
Throws:
IllegalArgumentException - the illegal argument exception

verbatimYear

private String verbatimYear(String date)
For a given user input date, this method returns the exact string the user entered after the last slash. This allows the formatter to distinguish between ambiguous values such as "/06" "/6" and "/0006"

Parameters:
date -
Returns:


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.