Project info for MonRG

Share This Created 24 Sep 2002 at 10:30 UTC by jhyde, last modified 18 Mar 2005 at 16:31 UTC by jhyde.


Freshmeat page:


ResGen (Resource Generator) generates wrapper-classes for Java resource bundles. For example, given

helloWorld=Hello, world!
noAccess=User {0} does not have access to {1}
ResGen generates
class MyResource {
private ResourceBundle bundle = ...;
protected String format(String template, Object[] params) {
public String getHelloWorld() {
return bundle.getString("helloWorld");
public String getNoAccess(String p0, String p1) {
return format(bundle.getString("noAccess"), new Object[] {p0, p1});
public java.lang.Exception newNoAccess(String p0, String p1) {
return new java.lang.Exception(getNoAccess(p0, p1));

As this example shows, ResGen generates a 'get' method for every resource, with parameters appropriate to the parameters embedded in the resource string. If the resource is some kind of exception, ResGen also generates a 'new' method to create an instance of that exception.

We've recently added support for C++ generation, and the ablity to ability to define messages in XML files. For an up to date list of features, visit the home page.

Possible future enhancements include:

  1. Convert code-generator into XSL engine, and allow clients to specify custom XSL style-sheets.
  2. Support for different generation styles, for example, separate interface & class.

ResGen is part of the Eigenbase Project. It was initially to be part of the Mondrian project, where it was known as the Mondrian Resource Generator (MonRG).

Keywords: Java, ResourceBundle, Resource, generator, type-safe, internationalization, i18n, localization, l10n.

License: LGPL

This project has the following developers:

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

Share this page