org.sonatype.gshell.util.converter.basic
Class DateConverter

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by org.sonatype.gshell.util.converter.ConverterSupport
          extended by org.sonatype.gshell.util.converter.basic.DateConverter
All Implemented Interfaces:
PropertyEditor, Converter

public class DateConverter
extends ConverterSupport

Converter for Date types.

Since:
2.0

Constructor Summary
DateConverter()
           
 
Method Summary
protected  Object convertToObject(String text)
          Converts the supplied text in to an instance of the editor type.
protected  String convertToString(Object value)
          Converts the supplied object to text.
 
Methods inherited from class org.sonatype.gshell.util.converter.ConverterSupport
getAsText, getType, getValue, setAsText, setValue, toObject, toString
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.beans.PropertyEditor
addPropertyChangeListener, getCustomEditor, getJavaInitializationString, getTags, isPaintable, paintValue, removePropertyChangeListener, supportsCustomEditor
 

Constructor Detail

DateConverter

public DateConverter()
Method Detail

convertToObject

protected Object convertToObject(String text)
                          throws Exception
Description copied from class: ConverterSupport
Converts the supplied text in to an instance of the editor type. The text will never be null, and trim() will already have been called.

Specified by:
convertToObject in class ConverterSupport
Parameters:
text - The text to convertToObject
Returns:
An instance of the converted type
Throws:
Exception - Conversion failed

convertToString

protected String convertToString(Object value)
Description copied from class: ConverterSupport
Converts the supplied object to text. The supplied object will always be an instance of the editor type, and specifically will never be null or a String (unless this is the String editor).

Overrides:
convertToString in class ConverterSupport
Parameters:
value - an instance of the editor type
Returns:
the text equivalent of the value


Copyright © 2008-2011 Sonatype. All Rights Reserved.