PropertySet - PropertySet Usage and Configuration

The PropertSet module is configured by a file that is to be located somewhere in the classpath of your application. It looks for the following files, in this order:

  1. /propertyset.xml
  2. /META-INF/propertyset.xml
  3. /META-INF/propertyset-default.xml

The propertyset-default.xml file will always be found, as it is included in propertyset.jar. You can override these configurations by writing your own propertyset.xml file and placing it in one of the above locations in the classpath. The configuration file must look like this:

<propertysets>
	<propertset name="baz" class="com.foo.bar.BazPropertySet">
		<arg name="some" value="thing"/>
		...
	</propertyset>
	...
</propertysets>

The code to use the above PropertySet would be:

import com.opensymphony.module.propertyset.*;
...
HashMap args = new HashMap();

// add parameters to the args map
PropertySet ps = PropertySetManager.getIntance("baz", args);

The values that are placed in the args map is specific to the PropertySet implementation. We recommend reading the javadocs for the implementation you plan to use to discover the required and optional configuration arguments in propertyset.xml as well as the runtime arguments passed in via the args Map above.