LowCodeSaveOptionsProviderOfAssembling

LowCodeSaveOptionsProviderOfAssembling class

Implementation to provide save options which save split parts to files and the path of resultant file are named as(it may contains directories): PathHeader+SheetPrefix+SheetIndex(or SheetName) +SplitPartPrefix+SplitPartIndex+PathTail.

class LowCodeSaveOptionsProviderOfAssembling extends AbstractLowCodeSaveOptionsProvider;

Constructors

NameDescription
constructor(AbstractLowCodeSaveOptionsProvider)Constructs from a parent object convertible to this.
constructor()Default Constructor.

Properties

PropertyTypeDescription
pathHeaderstringHeader part(before added content of sheet and split part) of file path.
pathTailstringTailing part(after sequence numbers) of file path. It should include extension of file name.
useSheetNamebooleanWhether builds the file path with sheet name instead of sheet index. Default value is false.
sheetPrefixstringPrefix for the index of worksheet.
splitPartPrefixstringPrefix for the index of split part.
sheetIndexOffsetnumberOffset of sheet’s index between what used in file path and its actual value(SplitPartInfo.SheetIndex).
splitPartIndexOffsetnumberOffset of split part’s index between what used in file path and its actual value(SplitPartInfo.PartIndex).
buildPathWithSheetAlwaysbooleanWhether add sheet index or name to file path always. Default value is false, that is, when there is only one sheet, the sheet index(or name) and corresponding prefix will not be added to the file path.
buildPathWithSplitPartAlwaysbooleanWhether add split part index to file path always. Default value is false, that is, when there is only one split part, the split part index and corresponding prefix will not be added to the file path.
saveOptionsTemplateLowCodeSaveOptionsThe template for creating instance of save options in GetSaveOptions(SplitPartInfo).

Methods

MethodDescription
getSaveOptions(SplitPartInfo)Gets the save options from which to get the output settings for currently split part.
finish(LowCodeSaveOptions)Releases resources after processing currently split part.

constructor(AbstractLowCodeSaveOptionsProvider)

Constructs from a parent object convertible to this.

constructor(obj: AbstractLowCodeSaveOptionsProvider);

Parameters:

ParameterTypeDescription
objAbstractLowCodeSaveOptionsProviderThe parent object.

constructor()

Default Constructor.

constructor();

pathHeader

Header part(before added content of sheet and split part) of file path.

pathHeader : string;

pathTail

Tailing part(after sequence numbers) of file path. It should include extension of file name.

pathTail : string;

useSheetName

Whether builds the file path with sheet name instead of sheet index. Default value is false.

useSheetName : boolean;

Remarks

The sheet name will never be rebuilt automatically. So when set it to true, please make sure there is no special sheet name that can cause invalid file path or name.

sheetPrefix

Prefix for the index of worksheet.

sheetPrefix : string;

Remarks

If there is only one worksheet and BuildPathWithSheetAlways is false, then this prefix and the sheet index(or name) will not be added to the resultant file path.

splitPartPrefix

Prefix for the index of split part.

splitPartPrefix : string;

Remarks

If there is only one split part and BuildPathWithSplitPartAlways is false, then this prefix and the split part index(0) will not be added to the resultant file path.

sheetIndexOffset

Offset of sheet’s index between what used in file path and its actual value(SplitPartInfo.SheetIndex).

sheetIndexOffset : number;

Remarks

Only takes effect when UseSheetName is false.

splitPartIndexOffset

Offset of split part’s index between what used in file path and its actual value(SplitPartInfo.PartIndex).

splitPartIndexOffset : number;

buildPathWithSheetAlways

Whether add sheet index or name to file path always. Default value is false, that is, when there is only one sheet, the sheet index(or name) and corresponding prefix will not be added to the file path.

buildPathWithSheetAlways : boolean;

buildPathWithSplitPartAlways

Whether add split part index to file path always. Default value is false, that is, when there is only one split part, the split part index and corresponding prefix will not be added to the file path.

buildPathWithSplitPartAlways : boolean;

saveOptionsTemplate

The template for creating instance of save options in GetSaveOptions(SplitPartInfo).

saveOptionsTemplate : LowCodeSaveOptions;

Remarks

If the template has been specified, then the created instance will copy all setting from it and update the output file accordingly.

getSaveOptions(SplitPartInfo)

Gets the save options from which to get the output settings for currently split part.

getSaveOptions(part: SplitPartInfo) : LowCodeSaveOptions;

Parameters:

ParameterTypeDescription
partSplitPartInfo

Returns

LowCodeSaveOptions

finish(LowCodeSaveOptions)

Releases resources after processing currently split part.

finish(part: LowCodeSaveOptions) : void;

Parameters:

ParameterTypeDescription
partLowCodeSaveOptionsthe save options used for currently split part.

Remarks

By default this method just closes the stream specified by the LowCodeSaveOptions.OutputStream directly(if the save options specified a Stream as destination). User may overwrite this method to control how to release resources according to their requirement and the implementation of GetSaveOptions(SplitPartInfo).