2016/02/07 - Apache Onami has been retired.

For more information, please explore the Attic.

Introduction

Apache Onami Converters is a set of com.google.inject.spi.TypeConverter implementation not already present in Guice, such as:

  • Format converters;
  • i18n converters;
  • Net converters;
  • Numbers converters;
  • SQL converters;
  • System converters.

    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.