------ Introduction to Apache Onami Converters ------ The Apache Onami Team ------ 2013 ~~ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ Introduction <> is a set of {{{http://google-guice.googlecode.com/git/javadoc/com/google/inject/spi/TypeConverter.html}com.google.inject.spi.TypeConverter}} implementation not already present in Guice, such as: * {{{./format.html}Format converters}}; * {{{./i18n.html}i18n converters}}; * {{{./net.html}Net converters}}; * {{{./numbers.html}Numbers converters}}; * {{{./sql.html}SQL converters}}; * {{{./system.html}System converters}}. Each converter is implemented as a self-binding module to be easy installed in the <<>> 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 {{{http://en.wikipedia.org/wiki/Service_provider_interface}Service provider interface}} Users that want to include a single module which contains all converters, can have a look at the {{{./complete.html}complete}} converters module. Learn also how to {{{./extend.html}Extend}} Onami Converters.