OSDN Git Service

EAからOracle用DDLが吐けるようになった
[ea2ddl/ea2ddl.git] / ea2ddl-common / src / main / java / org / seasar / extension / jdbc / gen / internal / util / CloseableUtil.java
1 /*\r
2  * Copyright 2004-2008 the Seasar Foundation and the Others.\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, \r
13  * either express or implied. See the License for the specific language\r
14  * governing permissions and limitations under the License.\r
15  */\r
16 package org.seasar.extension.jdbc.gen.internal.util;\r
17 \r
18 import java.io.Closeable;\r
19 import java.io.IOException;\r
20 \r
21 import org.seasar.framework.log.Logger;\r
22 \r
23 /**\r
24  * {@link Closeable}のユーティリティクラスです。\r
25  * \r
26  * @author taedium\r
27  */\r
28 public class CloseableUtil {\r
29 \r
30     /** ロガー */\r
31     protected static Logger logger = Logger.getLogger(Closeable.class);\r
32 \r
33     /**\r
34      * \r
35      */\r
36     protected CloseableUtil() {\r
37     }\r
38 \r
39     /**\r
40      * クローズします。\r
41      * \r
42      * @param closeable\r
43      *            {@link Closeable}\r
44      */\r
45     public static void close(Closeable closeable) {\r
46         try {\r
47             if (closeable != null) {\r
48                 closeable.close();\r
49             }\r
50         } catch (IOException ignore) {\r
51             logger.log(ignore);\r
52         }\r
53     }\r
54 }\r