Home Manual Reference Source Test
import XMLTransformer from 'atscm/src/lib/transform/XMLTransformer.js'
public class | source

XMLTransformer

Extends:

src/lib/transform/PartialTransformer.js~PartialTransformerSplittingTransformer → XMLTransformer

Direct Subclass:

ConfigTransformer

A transformer used to transform XML documents.

Test:

Constructor Summary

Public Constructor
public

constructor(options: Object)

Creates a new XMLTransformer based on some options.

Member Summary

Public Members
public get

Returns the XML builder to use based on the current Transformer#direction.

Private Members
private

The builder to use with direction TransformDirection.FromDB.

private

The builder to use with direction TransformDirection.FromFilesystem.

Method Summary

Public Methods
public

decodeContents(node: Node): *

Parses XML in a node's contents.

public

encodeContents(object: Object): *

Builds an XML string from an object.

Inherited Summary

From class SplittingTransformer
public static get abstract

The extension to add to container node names when they are pulled.

public static get abstract

The source file extensions to allow.

public static

splitFile(node: Node, newExtension: string): Node

Splits a Node: The resulting is a clone of the input file, with a different path.

public abstract

combineNodes(node: BrowsedNode, sourceNodes: Map<string, BrowsedNode>, context: any)

Combines the container node and the source nodes to one single node.

public

Returns false for all container nodes, so they don't get read.

public

async transformFromDB(node: BrowsedNode, context: any)

Renames a container node, should be called by all subclasses.

public

async transformFromFilesystem(node: BrowsedNode, context: Object)

Reads a given container nodes source nodes and combines them.

private

_combineNodes(node: BrowsedNode, sourceNodes: {[extension: string]}, context: any)

Combines the container node and the source nodes to one single node by calling SplittingTransformer#combineNodes.

Public Constructors

public constructor(options: Object) source

Creates a new XMLTransformer based on some options.

Params:

NameTypeAttributeDescription
options Object
  • optional

The options to use.

Test:

Public Members

public get builder: function(object: Object): string source

Returns the XML builder to use based on the current Transformer#direction.

Test:

Private Members

private _fromDBBuilder: function(object: Object): string source

The builder to use with direction TransformDirection.FromDB.

private _fromFilesystemBuilder: function(object: Object): string source

The builder to use with direction TransformDirection.FromFilesystem.

Public Methods

public decodeContents(node: Node): * source

Parses XML in a node's contents.

Params:

NameTypeAttributeDescription
node Node

The node to process.

Return:

*

public encodeContents(object: Object): * source

Builds an XML string from an object.

Params:

NameTypeAttributeDescription
object Object

The object to encode.

Return:

*