Package com.cloudforge.core.config
Class InteractivePrompter
java.lang.Object
com.cloudforge.core.config.InteractivePrompter
Interactive prompting utility that generates questions from @ConfigField annotations.
Uses ConfigurationIntrospector to discover fields and automatically
generates appropriate prompts based on field metadata.
Usage
DeploymentConfig config = new DeploymentConfig();
InteractivePrompter prompter = new InteractivePrompter(System.in, System.out);
prompter.promptForConfiguration(config, applicationSpec);
- Since:
- 3.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionInteractivePrompter(InputStream input, PrintStream output) Creates a new InteractivePrompter with the specified input and output streams. -
Method Summary
Modifier and TypeMethodDescriptionvoidpromptForCategory(DeploymentConfig config, ApplicationSpec appSpec, String category) Prompts for fields in a specific category.voidpromptForConfiguration(DeploymentConfig config, ApplicationSpec appSpec) Prompts for all visible configuration fields.
-
Constructor Details
-
InteractivePrompter
Creates a new InteractivePrompter with the specified input and output streams.- Parameters:
input- input stream for reading user responsesoutput- output stream for displaying prompts
-
-
Method Details
-
promptForConfiguration
Prompts for all visible configuration fields.Iterates through visible fields (based on application capabilities and current configuration state) and prompts for values.
- Parameters:
config- the configuration object to populateappSpec- the application spec for determining field visibility
-
promptForCategory
Prompts for fields in a specific category.- Parameters:
config- the configuration object to populateappSpec- the application speccategory- the category to prompt for
-