RbGenerator is a Java resourcebundle source file Generator.
It translates .properties files into .java files which could then be compiled using a Java compilator.
Features:
Please also check our RbGenerator Wiki Page for more information.
The RbGenerator uses a logging system to report errors and exceptions during generation. There are 2 types of loggers:
RbUtils provides a xsl file to let you transform a RbGenerator xml report file into a html file. It can be found in the contrib/ directory.
Here are examples of generated output:
In a src_dir directory, we have the following properties source
files in a org/x38 subdirectory:
message.properties: alert.lbl=Error alert.value="This should not be selected" message_fr.properties: alert.lbl=Erreur alert.value="Ceci ne devrait pas être sélectionné"
RbGenerator will generate in a gen_dir directory the following Java
files:
package org.x38;
import java.util.ListResourceBundle;
public class message extends ListResourceBundle {
public static final String ALERT_LBL = "alert.lbl";
public static final String ALERT_VALUE = "alert.value";
public Object[][] getContents() {
return contents;
}
private static Object[][] contents = {
{ ALERT_LBL, "Error" },
{ ALERT_VALUE, "\"This should not be selected\"" }
};
protected Object[][] getContents() {
return contents;
}
}
package org.x38;
import java.util.ListResourceBundle;
public class message_fr extends message {
public Object[][] getContents() {
return contents;
}
private static Object[][] contents = {
{ ALERT_LBL, "Erreur" },
{ ALERT_VALUE, "\"Ceci ne devrait pas être sélectionné\"" }
};
protected Object[][] getContents() {
return contents;
}
}