Package io.dropwizard.core.cli
Class CheckCommand<T extends Configuration>
- java.lang.Object
-
- io.dropwizard.core.cli.Command
-
- io.dropwizard.core.cli.ConfiguredCommand<T>
-
- io.dropwizard.core.cli.CheckCommand<T>
-
- Type Parameters:
T- theConfigurationsubclass which is loaded from the configuration file
public class CheckCommand<T extends Configuration> extends ConfiguredCommand<T>
Parses and validates the application's configuration.
-
-
Constructor Summary
Constructors Constructor Description CheckCommand(Application<T> application)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<T>getConfigurationClass()Returns theClassof the configuration type.voidonError(Cli cli, net.sourceforge.argparse4j.inf.Namespace namespace, Throwable e)Method is called if there is an issue parsing configuration, setting up the environment, or running the command itself.protected voidrun(Bootstrap<T> bootstrap, net.sourceforge.argparse4j.inf.Namespace namespace, T configuration)Runs the command with the givenBootstrapandConfiguration.-
Methods inherited from class io.dropwizard.core.cli.ConfiguredCommand
addFileArgument, cleanup, cleanupAsynchronously, configure, getConfiguration, run
-
Methods inherited from class io.dropwizard.core.cli.Command
getDescription, getName
-
-
-
-
Constructor Detail
-
CheckCommand
public CheckCommand(Application<T> application)
-
-
Method Detail
-
getConfigurationClass
protected Class<T> getConfigurationClass()
Description copied from class:ConfiguredCommandReturns theClassof the configuration type.- Overrides:
getConfigurationClassin classConfiguredCommand<T extends Configuration>- Returns:
- the
Classof the configuration type
-
run
protected void run(Bootstrap<T> bootstrap, net.sourceforge.argparse4j.inf.Namespace namespace, T configuration) throws Exception
Description copied from class:ConfiguredCommandRuns the command with the givenBootstrapandConfiguration.- Specified by:
runin classConfiguredCommand<T extends Configuration>- Parameters:
bootstrap- the bootstrap bootstrapnamespace- the parsed command line namespaceconfiguration- the configuration object- Throws:
Exception- if something goes wrong
-
onError
public void onError(Cli cli, net.sourceforge.argparse4j.inf.Namespace namespace, Throwable e)
Description copied from class:CommandMethod is called if there is an issue parsing configuration, setting up the environment, or running the command itself. The default is printing the stacktrace to facilitate debugging, but can be customized per command.
-
-