public PropertyDefinitionMap(@NotNull String name, String description, boolean required, PropertyDefinition... properties) { super(name, description, required); if (properties != null) { for (PropertyDefinition property : properties) { put(property); } } }
private static PropertyDefinitionMap parseMapProperty(MapProperty mapProperty, AbstractPropertyMap defaultConfigurationParentMap) throws InvalidPluginDescriptorException { String description = parseMultiValue(mapProperty.getDescription(), mapProperty.getLongDescription()); PropertyDefinitionMap propDefMap = new PropertyDefinitionMap(mapProperty.getName().intern(), description, mapProperty.isRequired()); String displayName = (mapProperty.getDisplayName() != null) ? mapProperty.getDisplayName() : StringUtils .deCamelCase(mapProperty.getName()); if (displayName!=null) { propDefMap.setDisplayName(displayName.intern()); } propDefMap.setReadOnly(mapProperty.isReadOnly()); propDefMap.setSummary(mapProperty.isSummary()); // Add an instance of the map to the default config, if appropriate. PropertyMap propMap; if (defaultConfigurationParentMap != null) { propMap = new PropertyMap(propDefMap.getName()); defaultConfigurationParentMap.put(propMap); } else { propMap = null; } // Process the map's nested properties. List<JAXBElement<? extends ConfigurationProperty>> nestedProperties = mapProperty.getConfigurationProperty(); int propertyOrderIndex = 0; for (JAXBElement<? extends ConfigurationProperty> jaxbProperty : nestedProperties) { ConfigurationProperty uncastedProperty = jaxbProperty.getValue(); PropertyDefinition propertyDefinition = parseProperty(uncastedProperty, propertyOrderIndex++, propMap); propDefMap.put(propertyDefinition); } return propDefMap; }