use of com.synopsys.integration.configuration.property.base.TypedProperty in project synopsys-detect by blackducksoftware.
the class PropertyConfigurationHelpContext method findPropertyParseErrors.
public Map<String, List<String>> findPropertyParseErrors(List<Property> knownProperties) {
Map<String, List<String>> exceptions = new HashMap<>();
for (Property property : knownProperties) {
if (property.getClass().isAssignableFrom(TypedProperty.class)) {
// TODO: Can we do this without reflection?
Optional<ValueParseException> exception = propertyConfiguration.getPropertyException((TypedProperty) property);
if (exception.isPresent()) {
List<String> propertyExceptions = exceptions.getOrDefault(property.getKey(), new ArrayList<>());
if (StringUtils.isNotBlank(exception.get().getMessage())) {
propertyExceptions.add(exception.get().getMessage());
} else {
propertyExceptions.add(exception.get().toString());
}
exceptions.put(property.getKey(), propertyExceptions);
}
}
}
return exceptions;
}
Aggregations