Interface: Transformer

olympe.dc. Transformer

A Transformer is a filter that will be applied to a set of Syncs, like ListDef, in order to extract, exclude, or reorder entries based on a series of criteria.

Methods


<abstract> getName()

Gets this Transformer unique name.

Returns:

The name.

Type
string

<abstract> getTransform(manager, stateResolver, callback)

Get the transformer's transform function. This is the method that implementations of Transformer must provide and is where the actual transformation will take place.

Parameters:
Name Type Description
manager olympe.dc.Manager

The DC manager.

stateResolver olympe.dc.ranking.StateResolver

The state resolver.

callback olympe.dc.Manager.TransformationCallback

The callback.

Returns:

The transform function.

Type
olympe.dc.Manager.TransformationCallback

<abstract> getValueType()

Gets the transformed item's value type. A null value means that the transformer will not change the type of the values (e.g. a sort transformer).

Returns:

Returns the transformed listDef value new type or null if this transformer does not change it

Type
function

<abstract> serialize(parameters)

Serializes the transformer.

Parameters:
Name Type Description
parameters olympe.dc.query.Parameters

The parameters for the serialization.

Throws:

If the transformer is not serializable.

Type
Error
Returns:

The JSON representation.

Type
string

<abstract> toString()

Gets a string representation of the transformer.

Returns:

The representation.

Type
string