Class I18nClassLoader

java.lang.Object
java.lang.ClassLoader
nz.org.riskscape.engine.i18n.I18nClassLoader

public class I18nClassLoader extends ClassLoader

ClassLoader for use with building ResourceBundles that uses an explicit search path for finding resources for use with ResourceBundleControl to control the order with which values from bundles over-write each other.

Maintains a list of class loaders and gives methods for adding new ones at various points to adjust precedence order. Precedence is based on list order where list item 0 is highest to list item n lowest.

Also adds a new getResourcesByPrecedence(String) method to allow the control file to create a MergedPropertiesResourceBundle with application-defined precedence. This allows us to make sure that things like default message can be replaced and redefined by plugins and then again by explicit i18n folders on the user's installed system.