Class ISO8601DateEditor

  • All Implemented Interfaces:
    java.beans.PropertyEditor

    public class ISO8601DateEditor
    extends java.beans.PropertyEditorSupport
    PropertyEditor suitable for use by BeanWrapperImpl, so that we can accept xsd:datetime formatted dates in query strings. Also handles "epoch" style dates, if they exist. Could be extended to guess the date format and do something useful with it
    Author:
    miskellc
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAsText()
      boolean isPaintable()
      No, we don't do GUIs.
      void setAsText​(java.lang.String text)
      static java.util.Date stringToDate​(java.lang.String text)  
      • Methods inherited from class java.beans.PropertyEditorSupport

        addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ISO8601DateEditor

        public ISO8601DateEditor()
    • Method Detail

      • getAsText

        public java.lang.String getAsText()
        Specified by:
        getAsText in interface java.beans.PropertyEditor
        Overrides:
        getAsText in class java.beans.PropertyEditorSupport
      • setAsText

        public void setAsText​(java.lang.String text)
                       throws java.lang.IllegalArgumentException
        Specified by:
        setAsText in interface java.beans.PropertyEditor
        Overrides:
        setAsText in class java.beans.PropertyEditorSupport
        Throws:
        java.lang.IllegalArgumentException
      • isPaintable

        public boolean isPaintable()
        No, we don't do GUIs. Sod off
        Specified by:
        isPaintable in interface java.beans.PropertyEditor
        Overrides:
        isPaintable in class java.beans.PropertyEditorSupport
      • stringToDate

        public static java.util.Date stringToDate​(java.lang.String text)
                                           throws java.lang.IllegalArgumentException,
                                                  java.lang.UnsupportedOperationException
        Throws:
        java.lang.IllegalArgumentException
        java.lang.UnsupportedOperationException