Allow modifying plugin project config values on read

Upon reading the values from the plugin project config, allow
modification of the values before returning the result to the client.

Commit 9e8cac67 implemented a possibility to modify plugin config
values on save, which is useful if the display format is different
from the storage format. This new method allows to undo this
transformation on read.

Change-Id: I2d5369b2876006fca170832760aa92e1db5a5f11
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2015-07-01 09:50:28 +02:00
parent 38cd2859dd
commit 9b0611e6b8
2 changed files with 36 additions and 3 deletions

View File

@@ -214,6 +214,34 @@ public class ProjectConfigEntry {
return configValue;
}
/**
* Called after reading the project config value. To modify the value before
* returning it to the client, override this method and return the modified
* value. Default implementation returns the same value.
*
* @param project the project.
* @param value the actual value of the config entry (computed out of the
* configured value, the inherited value and the default value).
* @return the modified value.
*/
public String onRead(ProjectState project, String value) {
return value;
}
/**
* Called after reading the project config value of type ARRAY. To modify the
* values before returning it to the client, override this method and return
* the modified values. Default implementation returns the same values.
*
* @param project the project.
* @param values the actual values of the config entry (computed out of the
* configured value, the inherited value and the default value).
* @return the modified values.
*/
public List<String> onRead(ProjectState project, List<String> values) {
return values;
}
/**
* Called after a project config is updated.
*