private void validateConditions(BaseCommand scope, CommandOperationContext operationContext) throws InvalidCommandArgument { validateConditions(scope.conditions, operationContext); if (scope.parentCommand != null) { validateConditions(scope.parentCommand, operationContext); } }
void validateConditions(CommandOperationContext context) throws InvalidCommandArgument { RegisteredCommand cmd = context.getRegisteredCommand(); validateConditions(cmd.conditions, context); validateConditions(cmd.scope, context); }
void invoke(CommandIssuer sender, List<String> args, CommandOperationContext context) { if (!scope.canExecute(sender, this)) { return; } preCommand(); try { this.manager.conditions.validateConditions(context); Map<String, Object> passedArgs = resolveContexts(sender, args); if (passedArgs == null) return; method.invoke(scope, passedArgs.values().toArray()); } catch (Exception e) { handleException(sender, args, e); } postCommand(); } public void preCommand() {}
this.manager.conditions.validateConditions(context, value); passedArgs.put(parameterName, value); this.manager.conditions.validateConditions(context, paramValue); passedArgs.put(parameterName, paramValue);