Search in sources :

Example 1 with JavaPackageConverter

use of org.springframework.roo.converters.JavaPackageConverter in project spring-roo by spring-projects.

the class JmsCommands method returnApplicationPackages.

@CliOptionAutocompleteIndicator(command = "jms receiver", param = "endpoint", validate = false, includeSpaceOnFinish = false, help = "--endpoint parameter parameter is the service where will be added the " + "support to send emails.")
public List<String> returnApplicationPackages(ShellContext shellContext) {
    List<String> applicationPackages = new ArrayList<String>();
    // Get only application modules
    StringBuffer matcher = new StringBuffer("feature[");
    matcher.append(ModuleFeatureName.APPLICATION).append("]");
    JavaPackageConverter converter = (JavaPackageConverter) getJavaPackageConverterService().get(0);
    List<Completion> completions = new ArrayList<Completion>();
    converter.getAllPossibleValues(completions, String.class, shellContext.getParameters().get("endpoint"), matcher.toString(), null);
    for (Completion completion : completions) {
        applicationPackages.add(completion.getValue());
    }
    return applicationPackages;
}
Also used : Completion(org.springframework.roo.shell.Completion) JavaPackageConverter(org.springframework.roo.converters.JavaPackageConverter) ArrayList(java.util.ArrayList) CliOptionAutocompleteIndicator(org.springframework.roo.shell.CliOptionAutocompleteIndicator)

Aggregations

ArrayList (java.util.ArrayList)1 JavaPackageConverter (org.springframework.roo.converters.JavaPackageConverter)1 CliOptionAutocompleteIndicator (org.springframework.roo.shell.CliOptionAutocompleteIndicator)1 Completion (org.springframework.roo.shell.Completion)1