Skip to content

Evaluators

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

An evaluator is a Coffig component type responsible for evaluating value node contents to resolve them if necessary. An evaluator implements the org.seedstack.coffig.spi.ConfigurationEvaluator interface.

Programmatic registration

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

Coffig.builder()
      .withEvaluators(new MyEvaluator())
      .build();

Declarative registration

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

org.myorg.myapp.MyEvaluator