Class InteractivePrompter

java.lang.Object
com.cloudforge.core.config.InteractivePrompter

public class InteractivePrompter extends Object
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 Details

    • InteractivePrompter

      public InteractivePrompter(InputStream input, PrintStream output)
      Creates a new InteractivePrompter with the specified input and output streams.
      Parameters:
      input - input stream for reading user responses
      output - output stream for displaying prompts
  • Method Details

    • promptForConfiguration

      public void promptForConfiguration(DeploymentConfig config, ApplicationSpec appSpec)
      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 populate
      appSpec - the application spec for determining field visibility
    • promptForCategory

      public void promptForCategory(DeploymentConfig config, ApplicationSpec appSpec, String category)
      Prompts for fields in a specific category.
      Parameters:
      config - the configuration object to populate
      appSpec - the application spec
      category - the category to prompt for