org.jboss.util.propertyeditor
Class DateEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by org.jboss.util.propertyeditor.DateEditor
All Implemented Interfaces:
PropertyEditor

public class DateEditor
extends PropertyEditorSupport

A property editor for Date.

Version:
$Revision: 1.4.18.5 $
Author:
Jason Dillon, David Jencks, Scott Stark, Adrian Brock, Dimitris Andreadis

Constructor Summary
DateEditor()
           
 
Method Summary
 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(String text)
          Parse the text into a java.util.Date by trying one by one the registered DateFormat(s).
 void setValue(Object value)
          Sets directly the java.util.Date value
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateEditor

public DateEditor()
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(Object value)
Sets directly the java.util.Date value

Specified by:
setValue in interface PropertyEditor
Overrides:
setValue in class PropertyEditorSupport
Parameters:
value - a java.util.Date

setAsText

public void setAsText(String text)
Parse the text into a java.util.Date by trying one by one the registered DateFormat(s).

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Parameters:
text - the string date

getAsText

public 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 interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Returns:
date as string


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.