Class AbstractConvertSubcommand.AbstractConversionCommandExecutor
java.lang.Object
gov.nist.secauto.metaschema.cli.processor.command.AbstractCommandExecutor
gov.nist.secauto.metaschema.cli.commands.AbstractConvertSubcommand.AbstractConversionCommandExecutor
- All Implemented Interfaces:
ICommandExecutor
- Enclosing class:
- AbstractConvertSubcommand
protected abstract static class AbstractConvertSubcommand.AbstractConversionCommandExecutor
extends AbstractCommandExecutor
Used by implementing classes to provide for execution of a conversion
command.
-
Nested Class Summary
Nested classes/interfaces inherited from interface gov.nist.secauto.metaschema.cli.processor.command.ICommandExecutor
ICommandExecutor.ExecutionFunction -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConversionCommandExecutor(CLIProcessor.CallingContext callingContext, org.apache.commons.cli.CommandLine commandLine) Construct a new command executor. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()protected abstract IBindingContextGet the binding context to use for data processing.protected abstract voidhandleConversion(URI source, Format toFormat, Writer writer, IBoundLoader loader) Called to perform a content conversion.Methods inherited from class gov.nist.secauto.metaschema.cli.processor.command.AbstractCommandExecutor
getCallingContext, getCommand, getCommandLine
-
Constructor Details
-
AbstractConversionCommandExecutor
protected AbstractConversionCommandExecutor(@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
Get the binding context to use for data processing.- Returns:
- the context
- Throws:
CommandExecutionException- if an error occurred getting the binding context
-
execute
- Specified by:
executein interfaceICommandExecutor- Specified by:
executein classAbstractCommandExecutor- Throws:
CommandExecutionException
-
handleConversion
protected abstract void handleConversion(@NonNull URI source, @NonNull Format toFormat, @NonNull Writer writer, @NonNull IBoundLoader loader) throws FileNotFoundException, IOException Called to perform a content conversion.- Parameters:
source- the resource to converttoFormat- the format to convert towriter- the writer to use to write converted contentloader- the Metaschema loader to use to load the content to convert- Throws:
FileNotFoundException- if the requested resource was not foundIOException- if there was an error reading or writing content
-