A Greex file, also known as advanced XML file, contains the advanced XML
condition or Greex Rule that is defined by a user. By localizing the Greex file, you can localize an
advanced XML condition or Greex Rule.
About this task
To localize a Greex
file:
Procedure
- Create the BundleResolver class and implement
the following methods within the class:
- getString(String key) method and return the localized
strings.
For example, to localize a Greex file using
properties files:
public class MyBundleResolver implements BundleResolver
{
Properties prop = new Properties();
public MyBundleResolver()
{
//read and initialize the property file
}
public String getString(String key)
{
Return prop.getProperty(key);
}
}
- Register the BundleResolver class with the
GreexContext using the registerBundle() method, for example:
public class MyApp
{
GreexContext ctx = new GreexContext();
ctx.registerBundle(new MyBundleResolver())
}