Class PrintConfigCommand

  • All Implemented Interfaces:
    io.bootique.command.Command

    public class PrintConfigCommand
    extends io.bootique.command.CommandWithMetadata
    Command for showing configuration.
    Since:
    15.0
    Version:
    17.0 2020-01-04 14:41:57
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.bootique
    Maven Artifact Id:
    bootique-printconfig
    • Constructor Detail

      • PrintConfigCommand

        public PrintConfigCommand​(com.google.inject.Provider<io.bootique.log.BootLogger> bootLogger,
                                  com.google.inject.Provider<io.bootique.meta.module.ModulesMetadata> modulesMetadata,
                                  com.google.inject.Injector injector)
        Constructor.
        Parameters:
        bootLogger - the boot logger.
        modulesMetadata - the metadata of the bootique modules.
        injector - the injector.
    • Method Detail

      • run

        public io.bootique.command.CommandOutcome run​(io.bootique.cli.Cli cli)
        Specified by:
        run in interface io.bootique.command.Command
        Specified by:
        run in class io.bootique.command.CommandWithMetadata
      • extractConfigValues

        protected void extractConfigValues​(Map<String,​Object> yaml,
                                           List<io.bootique.meta.config.ConfigMetadataNode> configs)
        Extract the definition from the given configurations.
        Parameters:
        yaml - the to fill out.
        configs - the configurations.
      • generateYaml

        protected String generateYaml​(Map<String,​Object> map)
                               throws com.fasterxml.jackson.core.JsonProcessingException
        Generate the Yaml representation of the given map.
        Parameters:
        map - the map to print out.
        Returns:
        the Yaml representation.
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - when the Json cannot be processed.
      • generateJson

        protected String generateJson​(Map<String,​Object> map)
                               throws com.fasterxml.jackson.core.JsonProcessingException
        Generate the Json representation of the given map.
        Parameters:
        map - the map to print out.
        Returns:
        the Json representation.
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - when the Json cannot be processed.
      • generateXml

        protected String generateXml​(Map<String,​Object> map)
                              throws com.fasterxml.jackson.core.JsonProcessingException
        Generate the Xml representation of the given map.
        Parameters:
        map - the map to print out.
        Returns:
        the Xml representation.
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - when XML cannot be processed.