Package org.jboss.util.propertyeditor
Class DateEditor
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- org.jboss.util.propertyeditor.DateEditor
-
- All Implemented Interfaces:
java.beans.PropertyEditor
public class DateEditor extends java.beans.PropertyEditorSupport
A property editor forDate
.- Version:
- $Revision$
-
-
Constructor Summary
Constructors Constructor Description DateEditor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAsText()
Returns either the cached string date, or the stored java.util.Date instance formated to string using the last of the registered DateFormat(s)static void
initialize()
Setup the parsing formats.void
setAsText(java.lang.String text)
Parse the text into a java.util.Date by trying one by one the registered DateFormat(s).void
setValue(java.lang.Object value)
Sets directly the java.util.Date value
-
-
-
Method Detail
-
initialize
public static void initialize()
Setup the parsing formats. Offered as a separate static method to allow testing of locale changes, since SimpleDateFormat will use the default locale upon construction. Should not be normally used!
-
setValue
public void setValue(java.lang.Object value)
Sets directly the java.util.Date value- Specified by:
setValue
in interfacejava.beans.PropertyEditor
- Overrides:
setValue
in classjava.beans.PropertyEditorSupport
- Parameters:
value
- a java.util.Date
-
setAsText
public void setAsText(java.lang.String text)
Parse the text into a java.util.Date by trying one by one the registered DateFormat(s).- Specified by:
setAsText
in interfacejava.beans.PropertyEditor
- Overrides:
setAsText
in classjava.beans.PropertyEditorSupport
- Parameters:
text
- the string date
-
getAsText
public java.lang.String getAsText()
Returns either the cached string date, or the stored java.util.Date instance formated to string using the last of the registered DateFormat(s)- Specified by:
getAsText
in interfacejava.beans.PropertyEditor
- Overrides:
getAsText
in classjava.beans.PropertyEditorSupport
- Returns:
- date as string
-
-