Skip to content

DataTransformerSchema

A set of DataTransformers that map data from the CARP namespace to another namespace, indexed by data type.

Implement one for each supported namespace and register it in the DataTransformerSchemaRegistry. The schema used for a study is selected by DataEndPoint.dataFormat or SmartphoneStudyProtocol.privacySchemaName.

Implementers

Constructors

DataTransformerSchema

DataTransformerSchema()

Properties

namespace

String get namespace

The type of namespace that this package can transform to (see e.g. NameSpace for pre-defined namespaces).

transformers

Map<String, DataTransformer> get transformers

A map of transformers in this schema, indexed by the data type they can transform.

Methods

add

void add(
  1. String format,
  2. DataTransformer transformer
)

Adds a transformer for data of type format, replacing any existing one.

onRegister

void onRegister()

Callback method when this schema is being registered.

transform

Data transform(
  1. Data data
)

Transforms data using the transformer for its data type.

Returns data unchanged if no transformer is found.