Class PrintConfigCommand
- java.lang.Object
-
- io.bootique.command.CommandWithMetadata
-
- org.arakhne.afc.bootique.printconfig.commands.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 Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
extractConfigValues(Map<String,Object> yaml, List<io.bootique.meta.config.ConfigMetadataNode> configs)
Extract the definition from the given configurations.protected String
generateJson(Map<String,Object> map)
Generate the Json representation of the given map.protected String
generateXml(Map<String,Object> map)
Generate the Xml representation of the given map.protected String
generateYaml(Map<String,Object> map)
Generate the Yaml representation of the given map.io.bootique.command.CommandOutcome
run(io.bootique.cli.Cli cli)
-
-
-
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 interfaceio.bootique.command.Command
- Specified by:
run
in classio.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.
-
-