Skip to content

Commit 6a275df

Browse files
committed
Apply formatter
1 parent 2a28393 commit 6a275df

15 files changed

+75
-74
lines changed

src/main/java/org/mybatis/scripting/freemarker/FreeMarkerLanguageDriver.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,15 +15,10 @@
1515
*/
1616
package org.mybatis.scripting.freemarker;
1717

18-
import freemarker.cache.ClassTemplateLoader;
19-
import freemarker.cache.TemplateLoader;
20-
import freemarker.template.Template;
21-
2218
import java.io.IOException;
2319
import java.io.StringReader;
2420
import java.nio.charset.StandardCharsets;
2521

26-
import freemarker.template.TemplateException;
2722
import org.apache.ibatis.executor.parameter.ParameterHandler;
2823
import org.apache.ibatis.mapping.BoundSql;
2924
import org.apache.ibatis.mapping.MappedStatement;
@@ -34,6 +29,11 @@
3429
import org.apache.ibatis.session.Configuration;
3530
import org.mybatis.scripting.freemarker.support.TemplateFilePathProvider;
3631

32+
import freemarker.cache.ClassTemplateLoader;
33+
import freemarker.cache.TemplateLoader;
34+
import freemarker.template.Template;
35+
import freemarker.template.TemplateException;
36+
3737
/**
3838
* Adds FreeMarker templates support to scripting in MyBatis. If you want to change or extend template loader
3939
* configuration, use can inherit from this class and override {@link #createFreeMarkerConfiguration()} method.

src/main/java/org/mybatis/scripting/freemarker/FreeMarkerLanguageDriverConfig.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,8 +30,6 @@
3030
import java.util.function.Consumer;
3131
import java.util.function.Function;
3232

33-
import freemarker.template.Configuration;
34-
import freemarker.template.Version;
3533
import org.apache.commons.text.WordUtils;
3634
import org.apache.ibatis.io.Resources;
3735
import org.apache.ibatis.logging.Log;
@@ -41,6 +39,9 @@
4139
import org.apache.ibatis.reflection.factory.DefaultObjectFactory;
4240
import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory;
4341

42+
import freemarker.template.Configuration;
43+
import freemarker.template.Version;
44+
4445
/**
4546
* Configuration class for {@link FreeMarkerLanguageDriver}.
4647
*

src/main/java/org/mybatis/scripting/freemarker/FreeMarkerSqlSource.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,21 +15,21 @@
1515
*/
1616
package org.mybatis.scripting.freemarker;
1717

18-
import freemarker.template.Template;
19-
import freemarker.template.TemplateException;
20-
2118
import java.io.CharArrayWriter;
2219
import java.io.IOException;
2320
import java.util.ArrayList;
2421
import java.util.HashMap;
2522
import java.util.Map;
2623

27-
import freemarker.template.Version;
2824
import org.apache.ibatis.builder.SqlSourceBuilder;
2925
import org.apache.ibatis.mapping.BoundSql;
3026
import org.apache.ibatis.mapping.SqlSource;
3127
import org.apache.ibatis.session.Configuration;
3228

29+
import freemarker.template.Template;
30+
import freemarker.template.TemplateException;
31+
import freemarker.template.Version;
32+
3333
/**
3434
* Applies provided parameter(s) to FreeMarker template. Then passes the result into default MyBatis engine (and it
3535
* finally replaces #{}-params to '?'-params). So, FreeMarker is used as preprocessor for MyBatis engine.

src/main/java/org/mybatis/scripting/freemarker/GeneratedParamsTemplateModel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2017 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,10 +15,10 @@
1515
*/
1616
package org.mybatis.scripting.freemarker;
1717

18-
import freemarker.template.TemplateModel;
19-
2018
import java.util.List;
2119

20+
import freemarker.template.TemplateModel;
21+
2222
/**
2323
* Just a wrapper for list of generated params. Only to be able to return this object from
2424
* {@link freemarker.template.TemplateHashModel#get(java.lang.String)} method.

src/main/java/org/mybatis/scripting/freemarker/MyBatisParamDirective.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2018 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,6 +15,10 @@
1515
*/
1616
package org.mybatis.scripting.freemarker;
1717

18+
import java.io.IOException;
19+
import java.util.List;
20+
import java.util.Map;
21+
1822
import freemarker.core.Environment;
1923
import freemarker.ext.util.WrapperTemplateModel;
2024
import freemarker.template.DefaultListAdapter;
@@ -28,21 +32,17 @@
2832
import freemarker.template.TemplateNumberModel;
2933
import freemarker.template.TemplateScalarModel;
3034

31-
import java.io.IOException;
32-
import java.util.List;
33-
import java.util.Map;
34-
3535
/**
3636
* Custom FreeMarker directive for generating "#{paramName}" declarations in convenient way. Problem is FreeMarker
3737
* supports this syntax natively and there are no chance to disable this (although it is deprecated). And to get
3838
* "#{paramName}" we should write ${r"#{paramName}"}. With this directive you can write more simple:
3939
*
4040
* <blockquote>
41-
*
41+
*
4242
* <pre>
4343
* &lt;@p name="paramName"/&gt;
4444
* </pre>
45-
*
45+
*
4646
* </blockquote>
4747
*
4848
* <p>
@@ -51,26 +51,26 @@
5151
* </p>
5252
*
5353
* <blockquote>
54-
*
54+
*
5555
* <pre>
5656
* &lt;#list ids as id&gt;
5757
* &lt;@p value=id/&gt;
5858
* &lt;#if id_has_next&gt;,&lt;/#if&gt;
5959
* &lt;/#list&gt;
6060
* </pre>
61-
*
61+
*
6262
* </blockquote>
6363
*
6464
* <p>
6565
* will be translated into
6666
* </p>
6767
*
6868
* <blockquote>
69-
*
69+
*
7070
* <pre>
7171
* #{_p0},#{_p1},#{_p2}
7272
* </pre>
73-
*
73+
*
7474
* </blockquote>
7575
*
7676
* <p>

src/main/java/org/mybatis/scripting/freemarker/ParamObjectAdapter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,16 +15,16 @@
1515
*/
1616
package org.mybatis.scripting.freemarker;
1717

18+
import java.util.ArrayList;
19+
import java.util.HashMap;
20+
1821
import freemarker.ext.beans.BeanModel;
1922
import freemarker.ext.beans.BeansWrapperBuilder;
2023
import freemarker.template.TemplateHashModel;
2124
import freemarker.template.TemplateModel;
2225
import freemarker.template.TemplateModelException;
2326
import freemarker.template.Version;
2427

25-
import java.util.ArrayList;
26-
import java.util.HashMap;
27-
2828
/**
2929
* Important: if you are using some object that already has property "p", then MyBatisParamDirective will be unavailable
3030
* from script.

src/main/java/org/mybatis/scripting/freemarker/support/TemplateFilePathProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* <b>IMPORTANT: This class required to use with mybatis 3.5.1+</b> and need to use with SQL provider annotation (such
3333
* as {@link org.apache.ibatis.annotations.SelectProvider} as follow: <br>
3434
* <br>
35-
*
35+
*
3636
* <pre>
3737
* package com.example.mapper;
3838
*
@@ -64,7 +64,7 @@
6464
*
6565
* }
6666
* </pre>
67-
*
67+
*
6868
* @author Kazuki Shimizu
6969
* @version 1.2.0
7070
*/
@@ -102,7 +102,7 @@ public static void setCustomTemplateFilePathGenerator(PathGenerator pathGenerato
102102
* If you applied an user define {@link FreeMarkerLanguageDriverConfig} for {@link FreeMarkerLanguageDriver}, please
103103
* same instance to the this class.
104104
* </p>
105-
*
105+
*
106106
* @param languageDriverConfig
107107
* A user defined {@link FreeMarkerLanguageDriverConfig}
108108
*/

src/test/java/DefaultPackageNameMapper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
/**
1817
* Copyright 2018-2019 the original author or authors.
1918
*

src/test/java/org/mybatis/scripting/freemarker/CustomizedDataContextMapper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2017 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,11 +15,11 @@
1515
*/
1616
package org.mybatis.scripting.freemarker;
1717

18+
import java.util.List;
19+
1820
import org.apache.ibatis.annotations.Lang;
1921
import org.apache.ibatis.annotations.Select;
2022

21-
import java.util.List;
22-
2323
/**
2424
* @author elwood
2525
*/

src/test/java/org/mybatis/scripting/freemarker/CustomizedDataContextTest.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,9 +15,11 @@
1515
*/
1616
package org.mybatis.scripting.freemarker;
1717

18-
import freemarker.template.SimpleScalar;
19-
import freemarker.template.Template;
20-
import freemarker.template.Version;
18+
import java.io.Reader;
19+
import java.sql.Connection;
20+
import java.util.List;
21+
import java.util.Map;
22+
2123
import org.apache.ibatis.io.Resources;
2224
import org.apache.ibatis.jdbc.ScriptRunner;
2325
import org.apache.ibatis.mapping.Environment;
@@ -33,10 +35,9 @@
3335
import org.junit.jupiter.api.BeforeAll;
3436
import org.junit.jupiter.api.Test;
3537

36-
import java.io.Reader;
37-
import java.sql.Connection;
38-
import java.util.List;
39-
import java.util.Map;
38+
import freemarker.template.SimpleScalar;
39+
import freemarker.template.Template;
40+
import freemarker.template.Version;
4041

4142
/**
4243
* @author elwood

0 commit comments

Comments
 (0)