Add a BeanParseListener interface to DynamicOptions.
This interface extends the DynamicBean interface allowing beans to access the Bean immediately before or after option parsing is done on the DynamicBeans. The plumbing is added to both the SSH and RestAPI layers to actually call this bean during parsing. Change-Id: Id39edfedc9612c42b8c35470e52cacc05d86bf43
This commit is contained in:
committed by
Zac Livingston
parent
4f083a841d
commit
156c9c9fac
@@ -63,7 +63,10 @@ class ParameterParser {
|
||||
T param, ListMultimap<String, String> in, HttpServletRequest req, HttpServletResponse res)
|
||||
throws IOException {
|
||||
CmdLineParser clp = parserFactory.create(param);
|
||||
DynamicOptions.parse(dynamicBeans, clp, param);
|
||||
DynamicOptions pluginOptions = new DynamicOptions(param, dynamicBeans);
|
||||
pluginOptions.parseDynamicBeans(clp);
|
||||
pluginOptions.setDynamicBeans();
|
||||
pluginOptions.onBeanParseStart();
|
||||
try {
|
||||
clp.parseOptionMap(in);
|
||||
} catch (CmdLineException | NumberFormatException e) {
|
||||
@@ -84,6 +87,7 @@ class ParameterParser {
|
||||
replyBinaryResult(req, res, BinaryResult.create(msg.toString()).setContentType("text/plain"));
|
||||
return false;
|
||||
}
|
||||
pluginOptions.onBeanParseEnd();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user