Module dev.metaschema.cli
Package dev.metaschema.cli.commands
Class AbstractValidateContentCommand.AbstractValidationCommandExecutor
java.lang.Object
dev.metaschema.cli.processor.command.AbstractCommandExecutor
dev.metaschema.cli.commands.AbstractValidateContentCommand.AbstractValidationCommandExecutor
- All Implemented Interfaces:
dev.metaschema.cli.processor.command.ICommandExecutor
- Enclosing class:
- AbstractValidateContentCommand
protected abstract class AbstractValidateContentCommand.AbstractValidationCommandExecutor
extends dev.metaschema.cli.processor.command.AbstractCommandExecutor
Drives the validation execution.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.metaschema.cli.processor.command.ICommandExecutor
dev.metaschema.cli.processor.command.ICommandExecutor.ExecutionFunction -
Constructor Summary
ConstructorsConstructorDescriptionAbstractValidationCommandExecutor(dev.metaschema.cli.processor.CallingContext callingContext, org.apache.commons.cli.CommandLine commandLine) Construct a new command executor. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Execute the validation operation.protected abstract dev.metaschema.databind.IBindingContextgetBindingContext(Set<dev.metaschema.core.model.constraint.IConstraintSet> constraintSets) Get the binding context to use for data processing.protected abstract dev.metaschema.core.model.IModulegetModule(org.apache.commons.cli.CommandLine commandLine, dev.metaschema.databind.IBindingContext bindingContext) Get the module to use for validation.protected abstract dev.metaschema.databind.IBindingContext.ISchemaValidationProvidergetSchemaValidationProvider(dev.metaschema.core.model.IModule module, org.apache.commons.cli.CommandLine commandLine, dev.metaschema.databind.IBindingContext bindingContext) Get the schema validation implementation requested based on the provided command line arguments.Methods inherited from class dev.metaschema.cli.processor.command.AbstractCommandExecutor
getCallingContext, getCommand, getCommandLine
-
Constructor Details
-
AbstractValidationCommandExecutor
public AbstractValidationCommandExecutor(@NonNull dev.metaschema.cli.processor.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 dev.metaschema.databind.IBindingContext getBindingContext(@NonNull Set<dev.metaschema.core.model.constraint.IConstraintSet> constraintSets) throws dev.metaschema.cli.processor.command.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:
dev.metaschema.cli.processor.command.CommandExecutionException- if a error occurred while getting the binding context
-
getModule
@NonNull protected abstract dev.metaschema.core.model.IModule getModule(@NonNull org.apache.commons.cli.CommandLine commandLine, @NonNull dev.metaschema.databind.IBindingContext bindingContext) throws dev.metaschema.cli.processor.command.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:
dev.metaschema.cli.processor.command.CommandExecutionException- if an error occurred while loading the module
-
getSchemaValidationProvider
@NonNull protected abstract dev.metaschema.databind.IBindingContext.ISchemaValidationProvider getSchemaValidationProvider(@NonNull dev.metaschema.core.model.IModule module, @NonNull org.apache.commons.cli.CommandLine commandLine, @NonNull dev.metaschema.databind.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 interfacedev.metaschema.cli.processor.command.ICommandExecutor- Specified by:
executein classdev.metaschema.cli.processor.command.AbstractCommandExecutor- Throws:
dev.metaschema.cli.processor.command.CommandExecutionException
-