/** * Given a configuration definition, this will build and return a "default configuration" that * can be validated with the definition. All required properties are set and all properties * that define a default value are also set. If a required property does not have a default * value defined in the definition, the property value will be set to <code>null</code>. * * Use this to help create the definition's default template. * * @param configurationDefinition the configuration definition whose default configuration is to be created * @return configuration the default configuration */ public static Configuration createDefaultConfiguration(ConfigurationDefinition configurationDefinition) { if (configurationDefinition == null) { throw new IllegalArgumentException("configurationDefinition == null"); } Configuration defaultConfig = new Configuration(); Map<String, PropertyDefinition> childPropertyDefinitions = configurationDefinition.getPropertyDefinitions(); for (PropertyDefinition childPropertyDefinition : childPropertyDefinitions.values()) { createDefaultProperty(childPropertyDefinition, defaultConfig); } return defaultConfig; }
.getMap(); for (PropertyDefinition childPropertyDefinition : childPropertyDefinitions.values()) { createDefaultProperty(childPropertyDefinition, (PropertyMap) property); createDefaultProperty(listMemberDefinitionMap, listMap); ((PropertyList) property).add(listMap); } else if (listMemberPropertyDefinition instanceof PropertyDefinitionSimple) {