Code example for SimpleDateFormat

Methods: toPattern

0
  public void setParameterFromObject(final Object o)
      throws ObjectFactoryException 
  { 
    super.setParameterFromObject(o);
    final SimpleDateFormat format = (SimpleDateFormat) o;
    setParameter("pattern", format.toPattern());
  } 
 
  /** 
   * Creates an object based on this description. 
   * 
   * @return The object. 
   */ 
  public Object createObject()
  { 
    final SimpleDateFormat format = (SimpleDateFormat) super.createObject();
    if (getParameter("pattern") != null) 
    { 
      format.applyPattern((String) getParameter("pattern"));
    } 
    return format;