Skip to content

Mappers

Adrien LAUER edited this page Feb 23, 2017 · 2 revisions

A mapper is a Coffig component type responsible for mapping nodes to a specific Java type. A mapper implements the org.seedstack.coffig.spi.ConfigurationMapper interface.

Programmatic registration

To register a mapper programmatically, you create an instance of the evaluator and add it as a parameter to the withMappers() Coffig builder method:

Coffig.builder()
      .withMappers(new MyMapper())
      .build();

Declarative registration

You can also register a mapper automatically by adding its fully qualified class name in META-INF/services/org.seedstack.coffig.spi.ConfigurationMapper:

org.myorg.myapp.MyMapper
Clone this wiki locally