MappingTransformer
Extends:
A Transformer that maps ReadStream.ReadResults to AtviseFiles.
Constructor Summary
Public Constructor | ||
public |
constructor(options: Object) Creates a new mapping transformer. |
Member Summary
Public Members | ||
public get |
|
Private Members | ||
private |
Contents of the reference files read but not used yet. |
Method Summary
Public Methods | ||
public |
transformFromDB(node: Node, encoding: string, callback: function(err: ?Error, data: ?AtviseFile)) Writes an AtviseFile for each ReadStream.ReadResult read. |
|
public |
transformFromFilesystem(node: Node, encoding: string, callback: function(err: ?Error, data: ?AtviseFile)): * Writes an AtviseFile for each Node read. |
Inherited Summary
From class Transformer | ||
public static |
combinedTransformer(transformers: Transformer[], direction: TransformDirection): function(node: Node): Promise<any> Returns a function that combines multiple transformer actions. |
|
public |
direction: * |
|
public |
compatTransform(direction: TransformDirection, node: Node, context: Object): * A transform wrapper that works with both async/await (atscm >= 1) and callback-based (atscm < 1)transformers. |
|
public |
readNodeFile(node: FileNode): boolean Determines if a node's value node should be read, e.G. The Variable.Bool file for a node defined in .Variable.Bool.Json. |
|
public |
async transformFromDB(node: BrowsedNode, context: Object) Must be overridden by all subclasses: Transforms the given node when using TransformDirection.FromDB. |
|
public |
async transformFromFilesystem(node: BrowsedNode, context: Object) Must be overridden by all subclasses: Transforms the given node when using TransformDirection.FromFilesystem. |
|
public |
withDirection(direction: TransformDirection): Transformer Returns the Transformer with the given direction. |
Public Constructors
public constructor(options: Object) source
Creates a new mapping transformer.
Override:
Transformer#constructorParams:
Name | Type | Attribute | Description |
options | Object |
|
The arguments passed to the Transformer constructor. |
Test:
Public Members
public get transformsReferenceConfigFiles: boolean source
true
as the mapping transformer should infer references from config files.
Private Members
Public Methods
public transformFromDB(node: Node, encoding: string, callback: function(err: ?Error, data: ?AtviseFile)) source
Writes an AtviseFile for each ReadStream.ReadResult read. If a read file has a
non-standard type (definition) an additional rc
file is pushed holding this type.
Override:
Transformer#transformFromDBParams:
Name | Type | Attribute | Description |
node | Node | The read result to create the file for. |
|
encoding | string | The encoding used. |
|
callback | function(err: ?Error, data: ?AtviseFile) | Called with the error that occurred while transforming the read result or the resulting file. |
Test:
public transformFromFilesystem(node: Node, encoding: string, callback: function(err: ?Error, data: ?AtviseFile)): * source
Writes an AtviseFile for each Node read.
Override:
Transformer#transformFromFilesystemParams:
Name | Type | Attribute | Description |
node | Node | The raw file. |
|
encoding | string | The encoding used. |
|
callback | function(err: ?Error, data: ?AtviseFile) | Called with the error that occurred while transforming the read result or the resulting file. |
Return:
* |