Package org.jboss.common.beans.property
Class DateEditor
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- org.jboss.common.beans.property.PropertyEditorSupport<java.util.Date>
-
- org.jboss.common.beans.property.DateEditor
-
- All Implemented Interfaces:
java.beans.PropertyEditor,PropertyEditor<java.util.Date>
public class DateEditor extends PropertyEditorSupport<java.util.Date>
A property editor forDate.
-
-
Constructor Summary
Constructors Constructor Description DateEditor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAsText()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 voidinitialize()Setup the parsing formats.voidsetAsText(java.lang.String text)Parse the text into a java.util.Date by trying one by one the registered DateFormat(s).voidsetValue(java.lang.Object value)Sets directly the java.util.Date value-
Methods inherited from class org.jboss.common.beans.property.PropertyEditorSupport
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getType, getValue, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
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:
setValuein interfacejava.beans.PropertyEditor- Specified by:
setValuein interfacePropertyEditor<java.util.Date>- Overrides:
setValuein classPropertyEditorSupport<java.util.Date>- 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:
setAsTextin interfacejava.beans.PropertyEditor- Specified by:
setAsTextin interfacePropertyEditor<java.util.Date>- Specified by:
setAsTextin classPropertyEditorSupport<java.util.Date>- 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:
getAsTextin interfacejava.beans.PropertyEditor- Specified by:
getAsTextin interfacePropertyEditor<java.util.Date>- Overrides:
getAsTextin classPropertyEditorSupport<java.util.Date>- Returns:
- date as string
-
-