/** * Return a list of possible completions given a prefix string that the user has * started typing. * * @param start the amount of text written so far * @param detailLevel the level of detail the user wants in completions, starting at * 1. Higher values request more detail, with values typically in the range [1..5] * @return the list of completion proposals */ @RequestMapping("/task") public CompletionProposalsResource taskCompletions(@RequestParam("start") String start, @RequestParam(value = "detailLevel", defaultValue = "1") @Min(value = 1, message = "The provided detail level must be greater than zero.") int detailLevel) { return assembler.toResource(taskCompletionProvider.complete(start, detailLevel)); }
@Bean public TaskCompletionProvider taskCompletionProvider() { List<RecoveryStrategy<?>> recoveryStrategies = Arrays.<RecoveryStrategy<?>>asList( emptyStartYieldsAppsTaskRecoveryStrategy(), expandOneDashToTwoDashesTaskRecoveryStrategy(), configurationPropertyNameAfterDashDashTaskRecoveryStrategy(), unfinishedConfigurationPropertyNameTaskRecoveryStrategy(), configurationPropertyValueHintTaskRecoveryStrategy()); List<TaskExpansionStrategy> expansionStrategies = Arrays.asList(addTaskAppOptionsExpansionStrategy(), unfinishedTaskAppNameExpansionStrategy(), // Make sure this one runs last, as it may clear already computed // proposals // and return its own as the sole candidates taskConfigurationPropertyValueHintExpansionStrategy()); return new TaskCompletionProvider(recoveryStrategies, expansionStrategies); }
/** * Return a list of possible completions given a prefix string that the user has * started typing. * * @param start the amount of text written so far * @param detailLevel the level of detail the user wants in completions, starting at * 1. Higher values request more detail, with values typically in the range [1..5] * @return the list of completion proposals */ @RequestMapping("/task") public CompletionProposalsResource taskCompletions(@RequestParam("start") String start, @RequestParam(value = "detailLevel", defaultValue = "1") @Min(value = 1, message = "The provided detail level must be greater than zero.") int detailLevel) { return assembler.toResource(taskCompletionProvider.complete(start, detailLevel)); }