Skip to content

On Transformations

Options are detected and modeled based on heuristics and explicit definitions. As such, they usually need to be refined, filtered, enhanced and otherwise modified before being useful in generators. Transformations are the primary mechanism by which option models are modified.

For example, the AllowedBooleanValuesTransformation is responsible for enriching option models with information on allowed boolean values. Transformations may also exclude options from generators, like the ChildlessExclusionTransformation, which filters any options that do not have any children (e.g.: properties).

Transformations are collected into a TransformationPipeline and applied to option models in the defined order. The order of transformations may be defined accessing the BindSightBuilder.TransformationPipeline.

Transformations may be sidestepped or overridden by registering a custom implementation of ITransformationsProvider. It is used when creating a transformation pipeline to be injected into the default PipelinedBindSightGeneratorOptionsProvider, which is responsible for generating the options to be fed into generators.