src/main/java/org/jboss/util/propertyeditor/DateEditor.java
public void setAsText(String text)
   {
      ParseException pe = null;
      
      for (int i = 0; i < formats.length; i++)
      {
         try
         {
            // try to parse the date
            DateFormat df = formats[i];
            Date date = df.parse(text);
            
            // store the date in both forms
            this.text = text;
            super.setValue(date);
            
            // done
            return;
         }
         catch (ParseException e)
         {
            // remember the last seen exception
            pe = e;
         }
      }
      // couldn't parse
      throw new NestedRuntimeException(pe);
   }
public void setAsText(String text)
   {
      ParseException pe = null;
      
      for (int i = 0; i < formats.length; i++)
      {
         try
         {
            // try to parse the date
            DateFormat df = formats[i];
            Date date = df.parse(text);
            
            // store the date in both forms
            this.text = text;
            super.setValue(date);
            
            // done
            return;
         }
         catch (ParseException e)
         {
            // remember the last seen exception
            pe = e;
         }
      }
      // couldn't parse
      throw new NestedRuntimeException(pe);
   }
public void setAsText ( String text ) { ParseException pe = null ; for ( int i = 0 ; i < formats . length ; i ++ ) { try { // try to parse the date DateFormat df = formats [ i ] ; Date date = df . parse ( text ) ; // store the date in both forms this . text = text ; super . setValue ( date ) ; // done return ; } catch ( ParseException e ) { // remember the last seen exception pe = e ; } } // couldn't parse throw new NestedRuntimeException ( pe ) ; }
Parse the text into a java.util.Date by trying
one by one the registered DateFormat(s).

@param text the string date
Parse the text into a java . util . Date by trying one by one the registered DateFormat ( s ) .