code: public void process (File sourceDir, File propsFile)
          throws IOException
      {
          String fileName = propsFile.getName();
          if (!fileName.endsWith(".properties")) {
              System.err.println("Ignoring non-properties file: " + propsFile);
              return;
          }
          fileName = fileName.substring(0, fileName.length()-".properties".length());
          File javaFile = new File(propsFile.getParent(), fileName + ".java");
          if (propsFile.lastModified() <= javaFile.lastModified()) {
              return;
          }
  
          String sourcePath = sourceDir.getAbsolutePath();
          String javaPath = javaFile.getAbsolutePath();
          if (!javaPath.startsWith(sourcePath)) {
              System.err.println("Ignoring properties file outside 'srcdir': " + propsFile);
              return;
          }
  
          String pkg = javaPath.substring(sourcePath.length());
          if (pkg.startsWith(File.separator)) {
              pkg = pkg.substring(1);
          }
          pkg = pkg.substring(0, pkg.indexOf(javaFile.getName()));
          if (pkg.endsWith(File.separator)) {
              pkg = pkg.substring(0, pkg.length()-1);
          }
          pkg = pkg.replace(File.separatorChar, '.');
  
          String clazz = javaFile.getName().substring(0, javaFile.getName().indexOf(".java"));
  
          System.out.println("Generating " + pkg + "." + clazz + "...");
          String generated = generate(pkg, clazz, propsFile);
          PrintWriter out = new PrintWriter(javaFile, "UTF-8");
          out.print(generated);
          out.close();
      }
docs: Converts a single i18n properties file to its corresponding source file.
  
  @param sourceDir the root of the source directory. Used to infer the package for the
  generated source given the path to the properties file and the root of the source directory.
  @param propsFile the properties file from which to generate a source file. Name must be of
  the form <code>X.properties</code> for any X.