예제 #1
0
 /**
  * Generate the preamble for the properties file. This includes the copyright and machine
  * generation warnings.
  *
  * @param writer The {@linkplain PrintWriter output stream}.
  */
 protected void generatePreamble(final PrintWriter writer) {
   writer.println(
       MessageFormat.format(
           preambleBundle.getString(propertiesCopyright.name()),
           localName(baseName) + "_" + locale.getLanguage(),
           new Date()));
   writer.println(
       MessageFormat.format(
           preambleBundle.getString(generatedPropertiesNotice.name()),
           getClass().getName(),
           new Date()));
 }
예제 #2
0
 /**
  * Construct a new {@link PropertiesFileGenerator}.
  *
  * @param baseName The base name of the {@linkplain ResourceBundle resource bundle}.
  * @param locale The target {@linkplain Locale locale}.
  */
 protected PropertiesFileGenerator(final String baseName, final Locale locale) {
   this.baseName = baseName;
   this.locale = locale;
   this.preambleBundle =
       ResourceBundle.getBundle(
           preambleBaseName,
           locale,
           Resources.class.getClassLoader(),
           new UTF8ResourceBundleControl());
 }