Caplin Trader 4.7.1

Class: module:caplin/element/factory/RendererFactory

module:caplin/element/factory/RendererFactory

Constructor

new module:caplin/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:caplin/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:caplin/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:caplin/element/Renderer

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

Creates the appropriate renderer instance to support the supplied renderer name.
Parameters:
Name Type Description
rendererType module:caplin/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:caplin/element/Renderer

createUpstreams(attributeDefinitions, node) → {Object}

Creates a renderer upstream.
Parameters:
Name Type Description
attributeDefinitions module:caplin/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.