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
protected abstract class AbstractValidateContentCommand.AbstractValidationCommandExecutor
extends AbstractCommandExecutor
Drives the validation execution.
-
Nested Class Summary
Nested classes/interfaces inherited from interface gov.nist.secauto.metaschema.cli.processor.command.ICommandExecutor
ICommandExecutor.ExecutionFunction -
Constructor Summary
ConstructorsConstructorDescriptionAbstractValidationCommandExecutor(CLIProcessor.CallingContext callingContext, org.apache.commons.cli.CommandLine commandLine) Construct a new command executor. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Execute the validation operation.protected abstract IBindingContextgetBindingContext(Set<gov.nist.secauto.metaschema.core.model.constraint.IConstraintSet> constraintSets) Get the binding context to use for data processing.protected abstract gov.nist.secauto.metaschema.core.model.IModulegetModule(org.apache.commons.cli.CommandLine commandLine, IBindingContext bindingContext) Get the module to use for validation.protected abstract IBindingContext.ISchemaValidationProvidergetSchemaValidationProvider(gov.nist.secauto.metaschema.core.model.IModule module, org.apache.commons.cli.CommandLine commandLine, IBindingContext bindingContext) Get the schema validation implementation requested based on the provided command line arguments.Methods inherited from class gov.nist.secauto.metaschema.cli.processor.command.AbstractCommandExecutor
getCallingContext, getCommand, getCommandLine
-
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 executioncommandLine- 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 informationbindingContext- 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 fromcommandLine- the provided command line argument informationbindingContext- the context used to access Metaschema module information based on Java class bindings- Returns:
- the provider
-
execute
Execute the validation operation.- Specified by:
executein interfaceICommandExecutor- Specified by:
executein classAbstractCommandExecutor- Throws:
CommandExecutionException
-