| java.lang.Object java.beans.PropertyEditorSupport org.springframework.beans.propertyeditors.CustomDateEditor
Constructor Summary | |
public | CustomDateEditor(DateFormat dateFormat, boolean allowEmpty) Create a new CustomDateEditor instance, using the given DateFormat
for parsing and rendering.
The "allowEmpty" parameter states if an empty String should
be allowed for parsing, i.e. | public | CustomDateEditor(DateFormat dateFormat, boolean allowEmpty, int exactDateLength) Create a new CustomDateEditor instance, using the given DateFormat
for parsing and rendering.
The "allowEmpty" parameter states if an empty String should
be allowed for parsing, i.e. |
Method Summary | |
public String | getAsText() Format the Date as String, using the specified DateFormat. | public void | setAsText(String text) Parse the Date from the given text, using the specified DateFormat. |
CustomDateEditor | public CustomDateEditor(DateFormat dateFormat, boolean allowEmpty)(Code) | | Create a new CustomDateEditor instance, using the given DateFormat
for parsing and rendering.
The "allowEmpty" parameter states if an empty String should
be allowed for parsing, i.e. get interpreted as null value.
Otherwise, an IllegalArgumentException gets thrown in that case.
Parameters: dateFormat - DateFormat to use for parsing and rendering Parameters: allowEmpty - if empty strings should be allowed |
CustomDateEditor | public CustomDateEditor(DateFormat dateFormat, boolean allowEmpty, int exactDateLength)(Code) | | Create a new CustomDateEditor instance, using the given DateFormat
for parsing and rendering.
The "allowEmpty" parameter states if an empty String should
be allowed for parsing, i.e. get interpreted as null value.
Otherwise, an IllegalArgumentException gets thrown in that case.
The "exactDateLength" parameter states that IllegalArgumentException gets
thrown if the String does not exactly match the length specified. This is useful
because SimpleDateFormat does not enforce strict parsing of the year part,
not even with setLenient(false) . Without an "exactDateLength"
specified, the "01/01/05" would get parsed to "01/01/0005".
Parameters: dateFormat - DateFormat to use for parsing and rendering Parameters: allowEmpty - if empty strings should be allowed Parameters: exactDateLength - the exact expected length of the date String |
getAsText | public String getAsText()(Code) | | Format the Date as String, using the specified DateFormat.
|
|
|