Class AbstractValidateContentCommand.AbstractValidationCommandExecutor

java.lang.Object
gov.nist.secauto.metaschema.cli.processor.command.AbstractCommandExecutor
gov.nist.secauto.metaschema.cli.commands.AbstractValidateContentCommand.AbstractValidationCommandExecutor
All Implemented Interfaces:
ICommandExecutor
Enclosing class:
AbstractValidateContentCommand

Drives the validation execution.
  • Constructor Details

    • AbstractValidationCommandExecutor

      public AbstractValidationCommandExecutor(@NonNull CLIProcessor.CallingContext callingContext, @NonNull org.apache.commons.cli.CommandLine commandLine)
      Construct a new command executor.
      Parameters:
      callingContext - the context of the command execution
      commandLine - the parsed command line details
  • Method Details

    • getBindingContext

      @NonNull protected abstract IBindingContext getBindingContext(@NonNull Set<gov.nist.secauto.metaschema.core.model.constraint.IConstraintSet> constraintSets) throws CommandExecutionException
      Get the binding context to use for data processing.
      Parameters:
      constraintSets - the constraints to configure in the resulting binding context
      Returns:
      the context
      Throws:
      CommandExecutionException - if a error occurred while getting the binding context
    • getModule

      @NonNull protected abstract gov.nist.secauto.metaschema.core.model.IModule getModule(@NonNull org.apache.commons.cli.CommandLine commandLine, @NonNull IBindingContext bindingContext) throws CommandExecutionException
      Get the module to use for validation.

      This module is used to generate schemas and as a source of built-in constraints.

      Parameters:
      commandLine - the provided command line argument information
      bindingContext - the context used to access Metaschema module information based on Java class bindings
      Returns:
      the loaded Metaschema module
      Throws:
      CommandExecutionException - if an error occurred while loading the module
    • getSchemaValidationProvider

      @NonNull protected abstract IBindingContext.ISchemaValidationProvider getSchemaValidationProvider(@NonNull gov.nist.secauto.metaschema.core.model.IModule module, @NonNull org.apache.commons.cli.CommandLine commandLine, @NonNull IBindingContext bindingContext)
      Get the schema validation implementation requested based on the provided command line arguments.

      It is typical for this call to result in the dynamic generation of a schema to use for validation.

      Parameters:
      module - the Metaschema module to generate the schema from
      commandLine - the provided command line argument information
      bindingContext - the context used to access Metaschema module information based on Java class bindings
      Returns:
      the provider
    • execute

      public void execute() throws CommandExecutionException
      Execute the validation operation.
      Specified by:
      execute in interface ICommandExecutor
      Specified by:
      execute in class AbstractCommandExecutor
      Throws:
      CommandExecutionException