* for it, this method is a no-op and will return immediately.
*
* @param configDef the configuration definition whose default template is to be created and set
*/
public static void initializeDefaultTemplate(ConfigurationDefinition configDef) {
ConfigurationTemplate defaultTemplate = configDef.getDefaultTemplate();
if (defaultTemplate == null) {
Configuration defaultConfig = createDefaultConfiguration(configDef);
// not everything should have a default template - only stuff that has default values
if (!defaultConfig.getProperties().isEmpty()) {
defaultTemplate = new ConfigurationTemplate(ConfigurationTemplate.DEFAULT_TEMPLATE_NAME,
ConfigurationTemplate.DEFAULT_TEMPLATE_NAME);
defaultTemplate.setDefault(true);
defaultTemplate.setConfiguration(defaultConfig);
configDef.putTemplate(defaultTemplate);
}
}
return;
}