コード例 #1
0
    /**
     * Formats the input time
     *
     * @param time the input time
     * @return the formatted time
     */
    public String formatTime(Date time) {
      SimpleDateFormat formatter;

      formatter =
          new SimpleDateFormat(
              Messages.getString("Letter.timeFormat", BUNDLE_NAME, locale), locale);
      return formatter.format(time);
    }
コード例 #2
0
 /**
  * Builds the letter header
  *
  * @throws IOException
  */
 public void buildHeader() throws IOException {
   emit(Messages.getString("Letter.date", BUNDLE_NAME, locale));
   appendSpacer();
   emit(formatDate(new Date()));
   emit(LINE_SEPARATOR);
   emit(Messages.getString("Letter.time", BUNDLE_NAME, locale));
   appendSpacer();
   emit(formatTime(new Date()));
   emit(LINE_SEPARATOR);
   emit(Messages.getString("Letter.hostId", BUNDLE_NAME, locale));
   appendSpacer();
   emit(hostId);
   emit(LINE_SEPARATOR);
   emit(Messages.getString("Letter.bank", BUNDLE_NAME, locale));
   appendSpacer();
   emit(bankName);
   emit(LINE_SEPARATOR);
   emit(Messages.getString("Letter.userId", BUNDLE_NAME, locale));
   appendSpacer();
   emit(userId);
   emit(LINE_SEPARATOR);
   emit(Messages.getString("Letter.username", BUNDLE_NAME, locale));
   appendSpacer();
   emit(username);
   emit(LINE_SEPARATOR);
   emit(Messages.getString("Letter.partnerId", BUNDLE_NAME, locale));
   appendSpacer();
   emit(partnerId);
   emit(LINE_SEPARATOR);
   emit(Messages.getString("Letter.version", BUNDLE_NAME, locale));
   appendSpacer();
   emit(version);
   emit(LINE_SEPARATOR);
   emit(LINE_SEPARATOR);
   emit(LINE_SEPARATOR);
 }
コード例 #3
0
 /**
  * Returns the value of the property key.
  *
  * @param key the property key
  * @param bundleName the bundle name
  * @param locale the bundle locale
  * @return the property value
  */
 protected String getString(String key, String bundleName, Locale locale) {
   return Messages.getString(key, bundleName, locale);
 }
コード例 #4
0
 /**
  * Builds the footer section
  *
  * @throws IOException
  */
 public void buildFooter() throws IOException {
   emit(Messages.getString("Letter.date", BUNDLE_NAME, locale));
   emit("                                  ");
   emit(Messages.getString("Letter.signature", BUNDLE_NAME, locale));
 }