new module:ct-element /factory /Renderer Factory()
The RendererFactory creates instances of a Renderer
based on pre-loaded XML renderer definitions.
Methods
create Downstreams(attribute Definitions, node) → {Object}
Creates a renderer downstream.
Parameters:
Name | Type | Description |
---|---|---|
attributeDefinitions |
module:ct-stream |
Attribute definitions. |
node |
Object | JSON object specifying downstreams and their transforms. |
Returns:
A map of stream names to downstreams.
- Type
- Object
create Renderer(renderer Name, field Names) → {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
.
create Renderer ByType(renderer Type, field Names) → {module:ct-element /Renderer}
Creates the appropriate renderer instance to support the supplied renderer name.
Parameters:
Name | Type | Description |
---|---|---|
rendererType |
module:ct-element |
The renderer type. |
fieldNames |
Array | The field names the renderer listens to. |
Returns:
Renderer of the type defined by the renderer type provided.
create Upstreams(attribute Definitions, node) → {Object}
Creates a renderer upstream.
Parameters:
Name | Type | Description |
---|---|---|
attributeDefinitions |
module:ct-stream |
Attribute definitions. |
node |
Object | JSON object specifying upstreams and their transforms. |
Returns:
A map of stream names to upstreams.
- Type
- Object
to String()
Returns a human-readable string representation of the object, which is useful for debugging.