Apache Onami Converters is a set of com.google.inject.spi.TypeConverter implementation not already present in Guice, such as:
Each converter is implemented as a self-binding module to be easy installed in the Injector as shown below:
import static com.google.inject.Guice.createInjector;
import static com.google.inject.name.Names.named;
import com.google.inject.AbstractModule;
import com.google.inject.Injector;
...
Injector injector = createInjector( new XXXConverter(),
new YYYConverter(),
new AbstractModule()
{
@Override
protected void configure()
{
bindConstant()
.annotatedWith( named( "charset" ) )
.to( "UTF-8" );
}
}
);Moreover, each converter can be discovered by the Service provider interface
Users that want to include a single module which contains all converters, can have a look at the complete converters module.
Learn also how to Extend Onami Converters.