Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Configuration Template

Programie edited this page Dec 16, 2014 · 3 revisions

You have to define a configuration template which defines which config paths are valid and which are the default values of them.

The template is a JSON file containing a map for all config paths.

Each path is a property containing a map with the property "defaultValue". The map might be extended with more properties in future version.

The "defaultValue" property is optional. But either a default value or a user defined value in the configuration file must be set, otherwise an UnsetConfigValueException will be thrown.

Example structure

{
	"path.to.my.value" :
	{
		"defaultValue" : "Some default value"
	},
	"path.to.my.defaultValue" :
	{
		"defaultValue" : "Set by template"
	},
	"path.to.my.otherValue" :
	{
	},
	"path.to.another.path" :
	{
		"defaultValue" : "This is the default value"
	}
}

Note: Trying to retrieve or set a value with a path not defined in the template will fail with an UnknownConfigValueException.

Clone this wiki locally