Caplin Trader 5.1.0

Class: module:ct-element/factory/RendererFactory

module:ct-element/factory/RendererFactory()

new module:ct-element/factory/RendererFactory()

The RendererFactory creates instances of a Renderer based on pre-loaded XML renderer definitions.

Methods

createDownstreams(attributeDefinitions, node) → {Object}

Creates a renderer downstream.

Parameters:
Name Type Description
attributeDefinitions module:ct-stream/attribute/AttributeDefinitions

Attribute definitions.

node Object

JSON object specifying downstreams and their transforms.

Returns:

A map of stream names to downstreams.

Type
Object

createRenderer(rendererName, fieldNames) → {module:ct-element/Renderer}

Creates the appropriate renderer instance to support the supplied renderer name.

Parameters:
Name Type Description
rendererName String

the logical name of the renderer.

fieldNames Array

the field names the renderer listens to.

Returns:

Renderer of the type defined by the logical name provided rendererName.

Type
module:ct-element/Renderer

createRendererByType(rendererType, fieldNames) → {module:ct-element/Renderer}

Creates the appropriate renderer instance to support the supplied renderer name.

Parameters:
Name Type Description
rendererType module:ct-element/factory/RendererType

The renderer type.

fieldNames Array

The field names the renderer listens to.

Returns:

Renderer of the type defined by the renderer type provided.

Type
module:ct-element/Renderer

createUpstreams(attributeDefinitions, node) → {Object}

Creates a renderer upstream.

Parameters:
Name Type Description
attributeDefinitions module:ct-stream/attribute/AttributeDefinitions

Attribute definitions.

node Object

JSON object specifying upstreams and their transforms.

Returns:

A map of stream names to upstreams.

Type
Object

toString()

Returns a human-readable string representation of the object, which is useful for debugging.