Add minimal description to ad-hoc properties

This commit is contained in:
Kris De Volder
2018-08-20 14:55:14 -07:00
parent 01d6829c17
commit ac32e27f44
2 changed files with 8 additions and 2 deletions

View File

@@ -108,7 +108,8 @@ public class AdHocSpringPropertyIndexProvider implements SpringPropertyIndexProv
if (props!=null) {
for (Object p : props.keySet()) {
if (p instanceof String) {
index.add(new PropertyInfo((String)p));
String filename = file.getName();
index.add(new PropertyInfo((String)p).setDescription("Ad-hoc property defined in '"+filename+"'"));
}
}
}

View File

@@ -68,7 +68,7 @@ public class PropertyInfo {
private String type;
final private String name;
final private Object defaultValue;
final private String description;
private String description;
private List<PropertySource> sources;
private Deprecation deprecation;
private ImmutableList<ValueHint> valueHints;
@@ -194,6 +194,11 @@ public class PropertyInfo {
return new PropertyInfo(alias, type, name, defaultValue, description, deprecation, valueHints, keyHints, valueProvider, keyProvider, sources);
}
public PropertyInfo setDescription(String description) {
this.description = description;
return this;
}
public void setDeprecation(Deprecation d) {
this.deprecation = d;
}