Skip to content

Commit b6cdcfa

Browse files
committed
Rename Freemarker -> FreemarkerModule
1 parent 431ce9c commit b6cdcfa

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

docs/asciidoc/modules/freemarker.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ http://freemarker.org[Freemarker templates] for Jooby.
2222
.Java
2323
[source, java, role="primary"]
2424
----
25-
import io.jooby.freemarker.Freemarker;
25+
import io.jooby.freemarker.FreemarkerModule;
2626
2727
{
28-
install(new Freemarker());
28+
install(new FreemarkerModule());
2929
3030
get("/", ctx -> {
3131
return new ModelAndView("index.ftl")
@@ -37,10 +37,10 @@ import io.jooby.freemarker.Freemarker;
3737
.Kotlin
3838
[source, kt, role="secondary"]
3939
----
40-
import io.jooby.freemarker.Freemarker
40+
import io.jooby.freemarker.FreemarkerModule
4141
4242
{
43-
install(Freemarker())
43+
install(FreemarkerModule())
4444
4545
get("/") {
4646
ModelAndView("index.ftl")
@@ -80,23 +80,23 @@ Custom Configuration object can be provided it programmatically:
8080
.Java
8181
[source, java, role="primary"]
8282
----
83-
import io.jooby.freemarker.Freemarker;
83+
import io.jooby.freemarker.FreemarkerModule;
8484
8585
{
8686
Configuration freemarker = new Configuration();
8787
88-
install(new Freemarker(freemarker));
88+
install(new FreemarkerModule(freemarker));
8989
}
9090
----
9191

9292
.Kotlin
9393
[source, kt, role="secondary"]
9494
----
95-
import io.jooby.freemarker.Freemarker
95+
import io.jooby.freemarker.FreemarkerModule
9696
9797
{
9898
val freemarker = Configuration()
9999
100-
install(Freemarker(freemarker))
100+
install(FreemarkerModule(freemarker))
101101
}
102102
----

modules/jooby-freemarker/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<version>${jooby.version}</version>
2626
</dependency>
2727

28-
<!-- Freemarker -->
28+
<!-- FreemarkerModule -->
2929
<dependency>
3030
<groupId>org.freemarker</groupId>
3131
<artifactId>freemarker</artifactId>

modules/jooby-freemarker/src/main/java/io/jooby/freemarker/Freemarker.java renamed to modules/jooby-freemarker/src/main/java/io/jooby/freemarker/FreemarkerModule.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import static io.jooby.TemplateEngine.TEMPLATE_PATH;
3232
import static io.jooby.TemplateEngine.normalizePath;
3333

34-
public class Freemarker implements Extension {
34+
public class FreemarkerModule implements Extension {
3535

3636
public static class Builder {
3737

@@ -124,15 +124,15 @@ private TemplateLoader defaultTemplateLoader(Environment env, String templatesPa
124124

125125
private String templatesPath;
126126

127-
public Freemarker(@Nonnull Configuration freemarker) {
127+
public FreemarkerModule(@Nonnull Configuration freemarker) {
128128
this.freemarker = freemarker;
129129
}
130130

131-
public Freemarker(@Nonnull String templatesPath) {
131+
public FreemarkerModule(@Nonnull String templatesPath) {
132132
this.templatesPath = templatesPath;
133133
}
134134

135-
public Freemarker() {
135+
public FreemarkerModule() {
136136
this(TemplateEngine.PATH);
137137
}
138138

@@ -146,7 +146,7 @@ public Freemarker() {
146146
services.put(Configuration.class, freemarker);
147147
}
148148

149-
public static Freemarker.Builder create() {
150-
return new Freemarker.Builder();
149+
public static FreemarkerModule.Builder create() {
150+
return new FreemarkerModule.Builder();
151151
}
152152
}

modules/jooby-freemarker/src/test/java/io/jooby/freemarker/FreemarkerTest.java renamed to modules/jooby-freemarker/src/test/java/io/jooby/freemarker/FreemarkerModuleTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import static org.junit.jupiter.api.Assertions.assertEquals;
1212

13-
public class FreemarkerTest {
13+
public class FreemarkerModuleTest {
1414

1515
public static class MyModel {
1616
public String firstname;
@@ -44,7 +44,7 @@ public String getLastname() {
4444

4545
@Test
4646
public void render() throws Exception {
47-
Configuration freemarker = Freemarker.create()
47+
Configuration freemarker = FreemarkerModule.create()
4848
.build(new Environment(getClass().getClassLoader(), ConfigFactory.empty(), "test"));
4949
FreemarkerTemplateEngine engine = new FreemarkerTemplateEngine(freemarker);
5050
MockContext ctx = new MockContext();
@@ -58,7 +58,7 @@ public void render() throws Exception {
5858

5959
@Test
6060
public void publicField() throws Exception {
61-
Configuration freemarker = Freemarker.create()
61+
Configuration freemarker = FreemarkerModule.create()
6262
.build(new Environment(getClass().getClassLoader(), ConfigFactory.empty(), "test"));
6363
FreemarkerTemplateEngine engine = new FreemarkerTemplateEngine(freemarker);
6464
MockContext ctx = new MockContext();
@@ -72,7 +72,7 @@ public void publicField() throws Exception {
7272

7373
@Test
7474
public void customTemplatePath() throws Exception {
75-
Configuration freemarker = Freemarker.create()
75+
Configuration freemarker = FreemarkerModule.create()
7676
.build(new Environment(getClass().getClassLoader(), ConfigFactory.empty().withValue("templates.path",
7777
ConfigValueFactory.fromAnyRef("foo"))));
7878
FreemarkerTemplateEngine engine = new FreemarkerTemplateEngine(freemarker);

0 commit comments

Comments
 (0)