Open CyborTronik opened 9 years ago
Generally, the class you should register in META-INF/services/org.sql2o.converters.ConvertersProvider
is not the converter per se, but another class which implements org.sql2o.converters.ConvertersProvider
. Something like this:
package com.github.cybortronik.registry.repository.sql2o.converters;
import org.sql2o.converters.Converter;
import org.sql2o.converters.ConvertersProvider;
import java.time.OffsetDateTime;
import java.util.Map;
public class Sql2oConvertersProvider implements ConvertersProvider {
@Override
public void fill(Map<Class<?>, Converter<?>> mapToFill) {
mapToFill.put(OffsetDateTime.class, new OffsetDateTimeConverter());
}
}
Of course, if you want to register only one converter, you could make OffsetDateTimeConverter
also implement the ConvertersProvider
interface. Then use it as a provider of itself:
@Override
public void fill(Map<Class<?>, Converter<?>> mapToFill) {
mapToFill.put(OffsetDateTime.class, this);
}
I'm getting:
for class registered in
META-INF/services/org.sql2o.converters.ConvertersProvider
: