Class AbstractExportableDataContent
java.lang.Object
zeroecho.sdk.content.api.AbstractExportableDataContent
- All Implemented Interfaces:
DataContent, ExportableDataContent
An abstract base class for exportable data content, providing default
implementations for managing input data and export mode.
This class is intended to be extended by concrete implementations that generate various forms of export output, such as raw binary streams, shell scripts, or platform-specific wrappers.
It manages:
- The
DataContentinput that is to be exported - The
ExportableDataContent.ExportModethat controls how the export is formatted
Implementing classes must override DataContent.getStream()
to provide the actual export logic based on the configured mode.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ExportableDataContent
ExportableDataContent.ExportMode -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataContentThe input data to be exported.protected ExportableDataContent.ExportModeThe export mode (RAW, BASH_SCRIPT, CMD_SCRIPT, etc.).Fields inherited from interface DataContent
DEFAULT_MAX_READ_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionCreates an exporter withExportableDataContent.ExportMode.RAWselected and no input. -
Method Summary
Modifier and TypeMethodDescriptionReturns the currently selected export mode.voidSets the export mode to control how the data is output.voidsetInput(DataContent input) Sets the inputDataContentfor export.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DataContent
getStream, toBytes, toText
-
Field Details
-
mode
The export mode (RAW, BASH_SCRIPT, CMD_SCRIPT, etc.). Defaults to RAW. -
input
The input data to be exported. Must be non-null before use.
-
-
Constructor Details
-
AbstractExportableDataContent
public AbstractExportableDataContent()Creates an exporter withExportableDataContent.ExportMode.RAWselected and no input.
-
-
Method Details
-
setInput
Sets the inputDataContentfor export.- Specified by:
setInputin interfaceDataContent- Parameters:
input- the input data to be exported- Throws:
NullPointerException- ifinputisnull
-
getExportMode
Returns the currently selected export mode.- Specified by:
getExportModein interfaceExportableDataContent- Returns:
- the
ExportableDataContent.ExportModein use
-
setExportMode
Sets the export mode to control how the data is output.- Specified by:
setExportModein interfaceExportableDataContent- Parameters:
mode- the desiredExportableDataContent.ExportMode
-