Class CLIConfigurator


  • public class CLIConfigurator
    extends Object
    Class responsible for defining CLI using annotations and injecting values extracted by the parser.
    Author:
    Clement Escoffier
    • Constructor Detail

      • CLIConfigurator

        public CLIConfigurator()
    • Method Detail

      • define

        public static CLI define​(Class<?> clazz)
        Creates an instance of the given class, and extracts the metadata from the given class.
        Parameters:
        clazz - the CLI class
        Returns:
        the defined CLI.
      • inject

        public static void inject​(CommandLine cli,
                                  Object object)
                           throws CLIException
        Injects the value in the annotated setter methods (Option and Argument.
        Parameters:
        cli - the cli
        object - the object to be injected
        Throws:
        CLIException - if an injection issue occurred.