Package nl.gx.webmanager.springmvc
Class DatePropertyEditor
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- nl.gx.webmanager.springmvc.DatePropertyEditor
-
- All Implemented Interfaces:
PropertyEditor
public class DatePropertyEditor extends PropertyEditorSupport
A property editor for Date objects. This works in tandem with the wmedit:datePicker JSP tag and is needed to support locale sensitive formatting and timezones.
-
-
Constructor Summary
Constructors Constructor Description DatePropertyEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAsText()
boolean
isSetNullOnEmptyDate()
Returns if the value should be set to null in case an empty date string is passed.void
setAsText(String text)
void
setDateFormat(DateFormat dateFormat)
Sets the syntax of the date/time passed as String to this property editor.void
setSetNullOnEmptyDate(boolean setNullOnEmptyDate)
Sets if the value should be set to null in case an empty date string is passed.-
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
-
-
-
-
Method Detail
-
setDateFormat
public void setDateFormat(DateFormat dateFormat)
Sets the syntax of the date/time passed as String to this property editor. If no date format explicitly set, the default dd/MM/yyyy is used.- Parameters:
dateFormat
- The date format to use to parse the String values and convert them to a Date- Since:
- 10.33.0
-
isSetNullOnEmptyDate
public boolean isSetNullOnEmptyDate()
Returns if the value should be set to null in case an empty date string is passed. Default is false.- Returns:
- true if the value should be set to null in case an empty date string is passed, false otherwise
- Since:
- 10.33.0
-
setSetNullOnEmptyDate
public void setSetNullOnEmptyDate(boolean setNullOnEmptyDate)
Sets if the value should be set to null in case an empty date string is passed.- Parameters:
setNullOnEmptyDate
- if true, the value should be set to null in case an empty date string is passed. If false, empty dates are ignored.- Since:
- 10.33.0
-
setAsText
public void setAsText(String text) throws IllegalArgumentException
- Specified by:
setAsText
in interfacePropertyEditor
- Overrides:
setAsText
in classPropertyEditorSupport
- Throws:
IllegalArgumentException
-
getAsText
public String getAsText()
- Specified by:
getAsText
in interfacePropertyEditor
- Overrides:
getAsText
in classPropertyEditorSupport
-
-