View Javadoc
1   /*
2    *    Copyright 2009-2022 the original author or authors.
3    *
4    *    Licensed under the Apache License, Version 2.0 (the "License");
5    *    you may not use this file except in compliance with the License.
6    *    You may obtain a copy of the License at
7    *
8    *       https://www.apache.org/licenses/LICENSE-2.0
9    *
10   *    Unless required by applicable law or agreed to in writing, software
11   *    distributed under the License is distributed on an "AS IS" BASIS,
12   *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *    See the License for the specific language governing permissions and
14   *    limitations under the License.
15   */
16  package org.mybatis.guice.binder;
17  
18  import com.google.inject.TypeLiteral;
19  
20  import org.apache.ibatis.type.TypeHandler;
21  
22  /**
23   * Bind the given {@code TypeHandler} to an already defined type.
24   */
25  public interface TypeHandlerBinder<T> {
26  
27    /**
28     * Bind the given {@code TypeHandler} to an already defined type.
29     *
30     * @param handler
31     *          The {@code TypeHandler} has to be bound
32     */
33    void with(Class<? extends TypeHandler<? extends T>> handler);
34  
35    /**
36     * Bind the given {@code TypeHandler} to an already defined type.
37     *
38     * @param handler
39     *          The {@code TypeHandler} has to be bound
40     */
41    void with(TypeLiteral<? extends TypeHandler<? extends T>> handler);
42  
43    /**
44     * Bind the given {@code TypeHandler} to an already defined type.
45     *
46     * @param handler
47     *          The {@code TypeHandler} has to be bound
48     */
49    void withProvidedTypeHandler(Class<? extends TypeHandler<? extends T>> handler);
50  
51    /**
52     * Bind the given {@code TypeHandler} to an already defined type.
53     *
54     * @param handler
55     *          The {@code TypeHandler} has to be bound
56     */
57    void withProvidedTypeHandler(TypeLiteral<? extends TypeHandler<? extends T>> handler);
58  
59  }