@CliOptionAutocompleteIndicator(command = "web flow", param = "module", help = "You should specify an existing module name for option --module.") public List<String> getModulePossibleValues(ShellContext shellContext) { List<String> possibleValues = new ArrayList<String>(); possibleValues.addAll(projectOperations.getModuleNames()); return possibleValues; }
private void addCompletionsForOtherModuleNames(final List<Completion> completions, final Pom targetModule) { for (final String moduleName : projectOperations.getModuleNames()) { if (StringUtils.isNotBlank(moduleName) && !moduleName.equals(targetModule.getModuleName())) { completions.add(new Completion(moduleName + MODULE_PATH_SEPARATOR, decorate(moduleName + MODULE_PATH_SEPARATOR, FG_CYAN), "Modules", 0)); } } }
@CliOptionAutocompleteIndicator(command = "repository jpa", param = "interface", help = "--interface option should be a new type.", validate = false, includeSpaceOnFinish = false) public List<String> getInterfacePossibleResults(ShellContext shellContext) { List<String> allPossibleValues = new ArrayList<String>(); // Add all modules to completions list Collection<String> modules = projectOperations.getModuleNames(); for (String module : modules) { if (StringUtils.isNotBlank(module) && !module.equals(projectOperations.getFocusedModule().getModuleName())) { allPossibleValues.add(module.concat(LogicalPath.MODULE_PATH_SEPARATOR) .concat(JavaPackageConverter.TOP_LEVEL_PACKAGE_SYMBOL).concat(".")); } else if (!projectOperations.isMultimoduleProject()) { // Add only JavaPackage completion allPossibleValues.add(String.format("%s.repository.", JavaPackageConverter.TOP_LEVEL_PACKAGE_SYMBOL)); } } // Always add base package allPossibleValues.add(JavaPackageConverter.TOP_LEVEL_PACKAGE_SYMBOL.concat(".")); return allPossibleValues; }
@CliOptionAutocompleteIndicator(command = "service", param = "class", help = "--class option should be a new class.", validate = false, includeSpaceOnFinish = false) public List<String> getClassPossibleResults(ShellContext shellContext) { List<String> allPossibleValues = new ArrayList<String>(); // Add all modules to completions list Collection<String> modules = projectOperations.getModuleNames(); for (String module : modules) { if (StringUtils.isNotBlank(module) && !module.equals(projectOperations.getFocusedModule().getModuleName())) { allPossibleValues.add(module.concat(LogicalPath.MODULE_PATH_SEPARATOR) .concat(JavaPackageConverter.TOP_LEVEL_PACKAGE_SYMBOL).concat(".")); } else if (!projectOperations.isMultimoduleProject()) { // Add only JavaPackage and JavaType completion allPossibleValues.add(String.format("%s.service.impl.", JavaPackageConverter.TOP_LEVEL_PACKAGE_SYMBOL)); } } // Always add base package allPossibleValues.add("~."); return allPossibleValues; }
@CliOptionAutocompleteIndicator(command = "service", param = "interface", help = "--interface option should be a new interface.", validate = false, includeSpaceOnFinish = false) public List<String> getInterfacePossibleResults(ShellContext shellContext) { List<String> allPossibleValues = new ArrayList<String>(); // Add all modules to completions list Collection<String> modules = projectOperations.getModuleNames(); for (String module : modules) { if (StringUtils.isNotBlank(module) && !module.equals(projectOperations.getFocusedModule().getModuleName())) { allPossibleValues.add(module.concat(LogicalPath.MODULE_PATH_SEPARATOR) .concat(JavaPackageConverter.TOP_LEVEL_PACKAGE_SYMBOL).concat(".")); } else if (!projectOperations.isMultimoduleProject()) { // Add only JavaPackage and JavaType completion allPossibleValues.add(String.format("%s.service.api.", JavaPackageConverter.TOP_LEVEL_PACKAGE_SYMBOL)); } } // Always add base package allPossibleValues.add("~."); return allPossibleValues; }
/** * This method is an autocomplete indicator for 'sei' parameter * of the 'ws endpoint' command. * * It only provides the existing modules in the generated project * to make easy the SEI specification * * @param context * @return */ @CliOptionAutocompleteIndicator(command = "ws endpoint", param = "sei", help = "--sei parameter should be a new class. You must not provide an existing class.", validate = false) public List<String> getAllModulesForSei(ShellContext context) { List<String> availableModules = new ArrayList<String>(); Collection<String> modules = getProjectOperations().getModuleNames(); for (String moduleName : modules) { if (StringUtils.isNotBlank(moduleName)) { availableModules.add(moduleName.concat(":")); } } return availableModules; }
/** * This method is an autocomplete indicator for 'class' parameter * of the 'ws endpoint' command. * * It only provides the existing modules in the generated project * to make easy the class specification * * @param context * @return */ @CliOptionAutocompleteIndicator(command = "ws endpoint", param = "class", help = "--class parameter should be a new class. You must not provide an existing class.", validate = false) public List<String> getAllModulesForClass(ShellContext context) { List<String> availableModules = new ArrayList<String>(); Collection<String> modules = getProjectOperations().getModuleNames(); for (String moduleName : modules) { if (StringUtils.isNotBlank(moduleName)) { availableModules.add(moduleName.concat(":")); } } return availableModules; }
List<String> existingWsdlFiles = new ArrayList<String>(); Collection<String> existingModules = getProjectOperations().getModuleNames(); String rootPath = getPathResolver().getRoot(); for (String moduleName : existingModules) {
public boolean getAllPossibleValues(final List<Completion> completions, final Class<?> targetType, final String existingData, final String optionContext, final MethodTarget target) { boolean filteredByFeature = false; if (optionContext != null) { for (ModuleFeatureName moduleFeatureName : ModuleFeatureName.values()) { if (optionContext.contains(moduleFeatureName.name())) { filteredByFeature = true; addModules(completions, optionContext, typeLocationService.getModuleNames(moduleFeatureName)); } } } if (!filteredByFeature) { addModules(completions, optionContext, projectOperations.getModuleNames()); } return true; }
@Override public boolean isWebFlowInstallationPossible() { if (getThymeleafViewResponseService() == null) { return false; } // Check if Thymeleaf view support is installed in any module boolean thymeleafInstalled = false; List<ControllerMVCResponseService> responseServices = getThymeleafViewResponseService(); for (String moduleName : projectOperations.getModuleNames()) { for (ControllerMVCResponseService responseService : responseServices) { if (responseService.isInstalledInModule(moduleName)) { thymeleafInstalled = true; break; } } } return projectOperations.isFeatureInstalled(FeatureNames.MVC) && thymeleafInstalled; }
Collection<String> modules = projectOperations.getModuleNames(); for (String module : modules) {
for (String moduleName : getProjectOperations().getModuleNames()) {
for (String moduleName : getProjectOperations().getModuleNames()) { allDeclaredTypes.addAll(getTypeLocationService().getTypesForModule( getProjectOperations().getPomFromModuleName(moduleName)));
for (String moduleName : projectOperations.getModuleNames()) { if (moduleName.equals("service-api")) { Pom module = projectOperations.getPomFromModuleName(moduleName); for (String moduleName : projectOperations.getModuleNames()) { if (moduleName.equals("service-impl")) { Pom module = projectOperations.getPomFromModuleName(moduleName);
for (String moduleName : projectOperations.getModuleNames()) { if (moduleName.equals("repository")) { Pom module = projectOperations.getPomFromModuleName(moduleName);
@CliOptionAutocompleteIndicator(command = "repository jpa", param = "interface", help = "--interface option should be a new type.", validate = false, includeSpaceOnFinish = false) public List<String> getInterfacePossibleResults(ShellContext shellContext) { List<String> allPossibleValues = new ArrayList<String>(); // Add all modules to completions list Collection<String> modules = projectOperations.getModuleNames(); for (String module : modules) { if (StringUtils.isNotBlank(module) && !module.equals(projectOperations.getFocusedModule().getModuleName())) { allPossibleValues.add(module.concat(LogicalPath.MODULE_PATH_SEPARATOR) .concat(JavaPackageConverter.TOP_LEVEL_PACKAGE_SYMBOL).concat(".")); } else if (!projectOperations.isMultimoduleProject()) { // Add only JavaPackage completion allPossibleValues.add(String.format("%s.repository.", JavaPackageConverter.TOP_LEVEL_PACKAGE_SYMBOL)); } } // Always add base package allPossibleValues.add(JavaPackageConverter.TOP_LEVEL_PACKAGE_SYMBOL.concat(".")); return allPossibleValues; }
Collection<String> modules = projectOperations.getModuleNames(); for (String module : modules) {
private String getDbreXmlPath() { for (final String moduleName : projectOperations.getModuleNames()) { final LogicalPath logicalPath = LogicalPath.getInstance( Path.SRC_MAIN_RESOURCES, moduleName); final String dbreXmlPath = projectOperations.getPathResolver() .getIdentifier(logicalPath, DBRE_XML); if (fileManager.exists(dbreXmlPath)) { return dbreXmlPath; } } return projectOperations.getPathResolver().getFocusedIdentifier( Path.SRC_MAIN_RESOURCES, DBRE_XML); }
for (String moduleName : projectOperations.getModuleNames()) { if (moduleName.equals("repository")) { Pom module = projectOperations.getPomFromModuleName(moduleName);