PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/plugin-module-codegen-maven-client/src/main/java/com/atlassian/maven/plugins/amps/codegen/prompter/common/component/ComponentImportPrompter.java

https://bitbucket.org/mmeinhold/amps
Java | 42 lines | 28 code | 11 blank | 3 comment | 0 complexity | 203b556e6f7cc98a46f57c44f0e9cab1 MD5 | raw file
 1package com.atlassian.maven.plugins.amps.codegen.prompter.common.component;
 2
 3import com.atlassian.maven.plugins.amps.codegen.annotations.ModuleCreatorClass;
 4import com.atlassian.maven.plugins.amps.codegen.prompter.AbstractModulePrompter;
 5import com.atlassian.plugins.codegen.modules.PluginModuleLocation;
 6import com.atlassian.plugins.codegen.modules.common.component.ComponentImportModuleCreator;
 7import com.atlassian.plugins.codegen.modules.common.component.ComponentImportProperties;
 8
 9import org.apache.commons.lang.StringUtils;
10import org.codehaus.plexus.components.interactivity.Prompter;
11import org.codehaus.plexus.components.interactivity.PrompterException;
12
13/**
14 * @since 3.6
15 */
16@ModuleCreatorClass(ComponentImportModuleCreator.class)
17public class ComponentImportPrompter extends AbstractModulePrompter<ComponentImportProperties>
18{
19
20    public ComponentImportPrompter(Prompter prompter)
21    {
22        super(prompter);
23
24    }
25
26    @Override
27    public ComponentImportProperties promptForBasicProperties(PluginModuleLocation moduleLocation) throws PrompterException
28    {
29        String fqInterface = promptFullyQualifiedJavaClass("Enter Fully Qualified Interface", "");
30        ComponentImportProperties props = new ComponentImportProperties(fqInterface);
31
32        props.setModuleKey(prompt("Module Key", StringUtils.uncapitalize(StringUtils.substringAfterLast(fqInterface, "."))));
33        props.setFilter(prompt("Filter (not required)"));
34
35        suppressAdvancedPrompt();
36        suppressExamplesPrompt();
37
38        return props;
39    }
40
41
42}