code: private DateFormat getDateFormat(Locale locale) {
  
          // PENDING(craigmcc) - Implement pooling if needed for performance?
  
          if (pattern == null && type == null) {
              throw new IllegalArgumentException("Either pattern or type must" +
                   " be specified.");
          }
  
          DateFormat df;
          if (pattern != null) {
              df = new SimpleDateFormat(pattern, locale);
          } else if (type.equals("both")) {
              df = DateFormat.getDateTimeInstance
                   (getStyle(dateStyle), getStyle(timeStyle), locale);
          } else if (type.equals("date")) {
              df = DateFormat.getDateInstance(getStyle(dateStyle), locale);
          } else if (type.equals("time")) {
              df = DateFormat.getTimeInstance(getStyle(timeStyle), locale);
          } else {
              // PENDING(craigmcc) - i18n
              throw new IllegalArgumentException("Invalid type: " + type);
          }
          df.setLenient(false);
          return (df);
  
      }
docs: <p>Return a <code>DateFormat</code> instance to use for formatting
  and parsing in this {@link Converter}.</p>
  
  @param locale  The <code>Locale</code> used to select formatting
  and parsing conventions
  @throws ConverterException if no instance can be created