When mapping a property sfm will looking for a getter/setter from the object to the source/target flat structure - ResultSet, Csv Row, etc …-. If it can’t find one it will then look for a Converter that gets transform to a supported type.

the default converter or in

sfm-converter Maven Central JavaDoc

the joda time one in

sfm-converter-joda-time Maven Central JavaDoc

the protobuf in

sfm-converter-protobuf Maven Central JavaDoc

It’s also possible to supply your own Converter<I, O> for a specific field by adding a ConverterProperty.

        .addColumnProperty("my_enum_column", ConverterProperty.of(MyEnum::factoryMethod))

you can also provide your converters using the ServiceLoader

  1. Create a org.simpleflatmapper.converter.ConverterFactoryProducer
    public class MyConverterFactoryProducer extends AbstractConverterFactoryProducer {
     public void produce(Consumer<? super ConverterFactory<?, ?>> consumer) {
         constantConverter(consumer, Date.class, MyType.class, new DateToMyTypeConverter());
  2. register the service in the META-INF/services/org.simpleflatmapper.converter.ConverterFactoryProducer file

Note that providing a Converter does not guarantee it will be the one being used. The ConverterService will elect one according to path length and type matching. I you want to predictably changed the way a property is instantiated you will need to set a custom getter for that type