diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 7c26c8e..7e0a3c7 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -4,6 +4,5 @@
import net.thauvin.erik.semver.Version;
-@Version(major = 2, minor = 1, patch = 1, preRelease = "beta")
+@Version(major = 1, minor = 0, patch = 0, preRelease = "beta")
public class A {
-// ...
- }
@Version(properties = "version.properties")
public class A {
-// ...
- }
+// ...
# version.properties
version.major=1
@@ -203,8 +200,7 @@ processor will automatically look for it.
@Version(template = "version.mustache")
public class A {
-// ...
- }
+// ...
The default @@ -483,7 +479,7 @@ keys may be assigned custom values:
@Version(
= "example.properties",
- properties = "example.",
+ keysPrefix = "example."
keysPrefix = "maj",
majorKey = "min",
minorKey = "build",
@@ -492,8 +488,7 @@ class="sourceCode java"> patchKey projectKey = "project"
)
public class Example {
-// ...
- }
# example.properties
example.project=Example
@@ -519,7 +514,7 @@ follows:
class="sourceCode xml">dependency>
<groupId>net.thauvin.erik</groupId>
<artifactId>semver</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.2.0</version>
<dependency> </
Please look at pom.xml @@ -528,40 +523,24 @@ href="https://github.com/ethauvin/semver/tree/master/examples/java">examples/jav directory for a sample:
mvn verify
To install and run from bld, just -add the dependency to your build file:
-public class ExampleBuild extends Project {
-public ExampleBuild() {
- // ...
- scope(compile)
- .include(dependency("net.thauvin.erik", "semver", version(1, 2, 1, "SNAPSHOT")));
- }
- }
Please look at ExamapleBuild -in the examples/java/bld -directory for a sample.
To install and run from Gradle, add the following to build.gradle:
-{
- repositories mavenCentral()
- }
-
-{
- dependencies 'net.thauvin.erik:semver:1.2.1-SNAPSHOT'
- annotationProcessor 'net.thauvin.erik:semver:1.2.1-SNAPSHOT'
- compileOnly }
-
-.withType(JavaCompile) {
- tasks.compilerArgs += [ "-Asemver.project.dir=$projectDir" ]
- options}
{
+ repositories mavenCentral()
+ }
+
+{
+ dependencies 'net.thauvin.erik:semver:1.2.0'
+ annotationProcessor 'net.thauvin.erik:semver:1.2.0'
+ compileOnly }
+
+.withType(JavaCompile) {
+ tasks.compilerArgs += [ "-Asemver.project.dir=$projectDir" ]
+ options}
The directory containing the configuration files
(version.properties
, version.mustache
) must be
specified using the semver.project.dir
processor
@@ -571,18 +550,18 @@ href="https://github.com/ethauvin/semver/blob/master/examples/java/src/generated
class will be automatically created in the build/generated
directory upon compiling.
Please look at build.gradle +href="https://github.com/ethauvin/semver/blob/master/examples/java/build.gradle">build.gradle in the examples/java/gradle +href="https://github.com/ethauvin/semver/tree/master/examples/java">examples/java directory for a sample.
In order to also incorporate the generated source code into the
source tree
, add the following to build.gradle:
.withType(JavaCompile) {
- tasks.generatedSourceOutputDirectory.set(file("${projectDir}/src/generated/java"))
- options}
.withType(JavaCompile) {
+ tasks.generatedSourceOutputDirectory.set(file("${projectDir}/src/generated/java"))
+ options}
The GeneratedVersion.java
file will now be located in src/generated
.
src/generated
.
href="https://kotlinlang.org/">Kotlin.
To generate a Kotlin version file, simply specify the
type
as follows:
import net.thauvin.erik.semver.Version
-
-@Version(properties = "version.properties", type="kt")
-open class Main {
-// ...
- }
import net.thauvin.erik.semver.Version
+
+@Version(properties = "version.properties", type="kt")
+open class Main {
+// ...
The Kotlin default template implements the same static fields and functions as @@ -611,19 +589,19 @@ sample.
To install and run from Gradle, add the following to build.gradle.kts:
-var semverProcessor = "net.thauvin.erik:semver:1.2.1-SNAPSHOT"
-
-{
- dependencies (semverProcessor)
- kapt(semverProcessor)
- compileOnly}
-
-{
- kapt {
- arguments ("semver.project.dir", projectDir)
- arg}
- }
var semverProcessor = "net.thauvin.erik:semver:1.2.0"
+
+{
+ dependencies (semverProcessor)
+ kapt(semverProcessor)
+ compileOnly}
+
+{
+ kapt {
+ arguments ("semver.project.dir", projectDir)
+ arg}
+ }
The directory containing the configuration files
(
- * To incorporate the generated source code into the source tree, add this directory as an additional source
- * location in your IDE.
- */
- @Override
- public void compile() throws Exception {
- var generated = new File(buildDirectory(), "generated");
- var ignore = generated.mkdir();
- this.compileOperation().compileOptions().addAll(List.of("-s", generated.getAbsolutePath()));
- super.compile();
- }
-
- @BuildCommand(summary = "Run the example")
- public void runExample() throws Exception {
- runOperation().fromProject(this).mainClass("com.example.Example").execute();
- }
}
diff --git a/examples/java/bld/src/main/java/com/example/App.java b/examples/java/bld/src/main/java/com/example/App.java
index 91134b7..9875a22 100644
--- a/examples/java/bld/src/main/java/com/example/App.java
+++ b/examples/java/bld/src/main/java/com/example/App.java
@@ -13,7 +13,7 @@ public final class App {
* @param args The command line parameters.
*/
public static void main(final String... args) {
- final var sdf = new SimpleDateFormat("EEE, d MMM yyyy 'at' HH:mm:ss z", Locale.US);
+ final SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy 'at' HH:mm:ss z", Locale.US);
System.out.println("-----------------------------------------------------");
diff --git a/examples/java/bld/src/main/java/com/example/Example.java b/examples/java/bld/src/main/java/com/example/Example.java
index 1829d52..63a4b53 100644
--- a/examples/java/bld/src/main/java/com/example/Example.java
+++ b/examples/java/bld/src/main/java/com/example/Example.java
@@ -9,7 +9,7 @@ import java.util.Locale;
keysPrefix = "example.")
public class Example {
public static void main(final String... args) {
- final var sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
+ final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
System.out.println("-- From Example -------------------------------------");
diff --git a/examples/java/gradle/src/generated/java/com/example/ExampleVersion.java b/examples/java/gradle/src/generated/java/com/example/ExampleVersion.java
index 943ebb0..1f3cf42 100644
--- a/examples/java/gradle/src/generated/java/com/example/ExampleVersion.java
+++ b/examples/java/gradle/src/generated/java/com/example/ExampleVersion.java
@@ -9,7 +9,7 @@ import java.util.Date;
public final class ExampleVersion {
public static final String PROJECT = "Java Example";
- public static final Date BUILDDATE = new Date(1692564205424L);
+ public static final Date BUILDDATE = new Date(1692423608415L);
public static final String VERSION = "8.4.97-alpha+T800";
/**
diff --git a/examples/java/gradle/src/generated/java/com/example/GeneratedVersion.java b/examples/java/gradle/src/generated/java/com/example/GeneratedVersion.java
index 28b778b..03423f9 100644
--- a/examples/java/gradle/src/generated/java/com/example/GeneratedVersion.java
+++ b/examples/java/gradle/src/generated/java/com/example/GeneratedVersion.java
@@ -14,7 +14,7 @@ import java.util.Date;
*/
public final class GeneratedVersion {
public static final String PROJECT = "Java App";
-public static final Date BUILDDATE = new Date(1692564205452L);
+public static final Date BUILDDATE = new Date(1692423608452L);
public static final int MAJOR = 11;
public static final int MINOR = 11;
public static final int PATCH = 20;
diff --git a/examples/java/gradle/src/main/java/com/example/App.java b/examples/java/gradle/src/main/java/com/example/App.java
index 91134b7..9875a22 100644
--- a/examples/java/gradle/src/main/java/com/example/App.java
+++ b/examples/java/gradle/src/main/java/com/example/App.java
@@ -13,7 +13,7 @@ public final class App {
* @param args The command line parameters.
*/
public static void main(final String... args) {
- final var sdf = new SimpleDateFormat("EEE, d MMM yyyy 'at' HH:mm:ss z", Locale.US);
+ final SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy 'at' HH:mm:ss z", Locale.US);
System.out.println("-----------------------------------------------------");
diff --git a/examples/java/gradle/src/main/java/com/example/Example.java b/examples/java/gradle/src/main/java/com/example/Example.java
index ce7b795..c8c8c0b 100644
--- a/examples/java/gradle/src/main/java/com/example/Example.java
+++ b/examples/java/gradle/src/main/java/com/example/Example.java
@@ -14,7 +14,7 @@ public final class Example {
* @param args The command line parameters.
*/
public static void main(final String... args) {
- final var sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
+ final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
System.out.println("-- From Example -------------------------------------");
diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar
index 605e3e4..e96bdc7 100644
Binary files a/lib/bld/bld-wrapper.jar and b/lib/bld/bld-wrapper.jar differ
diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties
index 3d087eb..5daccca3 100644
--- a/lib/bld/bld-wrapper.properties
+++ b/lib/bld/bld-wrapper.properties
@@ -6,4 +6,4 @@ bld.extensions-testng=com.uwyn.rife2:bld-testng:0.9.1-SNAPSHOT
bld.repositories=MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.downloadLocation=
bld.sourceDirectories=
-bld.version=1.7.2
+bld.version=1.7.1
diff --git a/src/main/java/net/thauvin/erik/semver/VersionProcessor.java b/src/main/java/net/thauvin/erik/semver/VersionProcessor.java
index 57422d2..1c9f150 100644
--- a/src/main/java/net/thauvin/erik/semver/VersionProcessor.java
+++ b/src/main/java/net/thauvin/erik/semver/VersionProcessor.java
@@ -34,6 +34,7 @@ package net.thauvin.erik.semver;
import com.github.mustachejava.DefaultMustacheFactory;
import com.github.mustachejava.Mustache;
+import com.github.mustachejava.MustacheFactory;
import com.github.mustachejava.MustacheNotFoundException;
import javax.annotation.processing.*;
@@ -78,11 +79,6 @@ public class VersionProcessor extends AbstractProcessor {
return template;
}
- private Mustache compileTemplate(final File dir, final String template) {
- final var mf = new DefaultMustacheFactory(dir);
- return mf.compile(template);
- }
-
private void error(final String s) {
log(Diagnostic.Kind.ERROR, s);
}
@@ -93,16 +89,16 @@ public class VersionProcessor extends AbstractProcessor {
}
private VersionInfo findValues(final Version version) throws IOException {
- final var versionInfo = new VersionInfo(version);
+ final VersionInfo versionInfo = new VersionInfo(version);
if (!version.properties().isEmpty()) {
- final var propsFile = getLocalFile(version.properties());
+ final File propsFile = getLocalFile(version.properties());
if (propsFile.isFile() && propsFile.canRead()) {
note("Found properties: " + propsFile.getName() + " (" + propsFile.getAbsoluteFile().getParent() + ')');
- final var p = new Properties();
+ final Properties p = new Properties();
- try (var reader = new InputStreamReader(
+ try (InputStreamReader reader = new InputStreamReader(
Files.newInputStream(propsFile.toPath()), StandardCharsets.UTF_8)) {
p.load(reader);
@@ -143,7 +139,7 @@ public class VersionProcessor extends AbstractProcessor {
private File getLocalFile(final String fileName) {
if (processingEnv != null) { // null when testing.
- final var prop = processingEnv.getOptions().get(Constants.SEMVER_PROJECT_DIR_ARG);
+ final String prop = processingEnv.getOptions().get(Constants.SEMVER_PROJECT_DIR_ARG);
if (prop != null) {
return new File(prop, fileName);
}
@@ -185,20 +181,20 @@ public class VersionProcessor extends AbstractProcessor {
*/
@Override
public boolean process(final Set extends TypeElement> annotations, final RoundEnvironment roundEnv) {
- final var isLocalTemplate = getLocalFile(Constants.DEFAULT_TEMPLATE_NAME).exists();
+ final boolean isLocalTemplate = getLocalFile(Constants.DEFAULT_TEMPLATE_NAME).exists();
for (final Element element : roundEnv.getElementsAnnotatedWith(Version.class)) {
- final var version = element.getAnnotation(Version.class);
+ final Version version = element.getAnnotation(Version.class);
if (element.getKind() == ElementKind.CLASS) {
- final var enclosingElement = element.getEnclosingElement();
+ final Element enclosingElement = element.getEnclosingElement();
if (enclosingElement.getKind() == ElementKind.PACKAGE) {
- final var packageElement = (PackageElement) enclosingElement;
+ final PackageElement packageElement = (PackageElement) enclosingElement;
try {
- final var versionInfo = findValues(version);
+ final VersionInfo versionInfo = findValues(version);
if (Constants.EMPTY.equals(version.packageName())) {
versionInfo.setPackageName(packageElement.getQualifiedName().toString());
}
note("Found version: " + versionInfo.getVersion());
- final var template = getTemplate(isLocalTemplate, version);
+ final String template = getTemplate(isLocalTemplate, version);
writeTemplate(version.type(), versionInfo, template);
} catch (IOException | MustacheNotFoundException e) {
@@ -236,27 +232,28 @@ public class VersionProcessor extends AbstractProcessor {
private void writeTemplate(final String type, final VersionInfo versionInfo, final String template)
throws IOException {
- final var dir = getLocalFile("");
- final var mustache = compileTemplate(dir, template);
+ final File dir = getLocalFile("");
+ final MustacheFactory mf = new DefaultMustacheFactory(dir);
+ final Mustache mustache = mf.compile(template);
- final var templateName = switch (mustache.getName()) {
+ final String templateName = switch (mustache.getName()) {
case Constants.DEFAULT_JAVA_TEMPLATE -> "default (Java)";
case Constants.DEFAULT_KOTLIN_TEMPLATE -> "default (Kotlin)";
default -> mustache.getName() + " (" + dir.getAbsolutePath() + ')';
};
note("Loaded template: " + templateName);
- final var fileName = versionInfo.getClassName() + '.' + type;
+ final String fileName = versionInfo.getClassName() + '.' + type;
if (Constants.KOTLIN_TYPE.equalsIgnoreCase(type)) {
- final var kaptGenDir = processingEnv.getOptions().get(Constants.KAPT_KOTLIN_GENERATED_OPTION_NAME);
+ final String kaptGenDir = processingEnv.getOptions().get(Constants.KAPT_KOTLIN_GENERATED_OPTION_NAME);
if (kaptGenDir == null) {
throw new IOException("Could not find the target directory for generated Kotlin files.");
}
- final var ktFile = new File(kaptGenDir, fileName);
+ final File ktFile = new File(kaptGenDir, fileName);
if (!ktFile.getParentFile().exists() && !ktFile.getParentFile().mkdirs()) {
note("Could not create target directory: " + ktFile.getParentFile().getAbsolutePath());
}
- try (var osw = new OutputStreamWriter(Files.newOutputStream(ktFile.toPath()),
+ try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(ktFile.toPath()),
StandardCharsets.UTF_8)) {
mustache.execute(osw, versionInfo).flush();
}
@@ -264,7 +261,7 @@ public class VersionProcessor extends AbstractProcessor {
} else {
final FileObject jfo = filer.createSourceFile(
versionInfo.getPackageName() + '.' + versionInfo.getClassName());
- try (var writer = jfo.openWriter()) {
+ try (Writer writer = jfo.openWriter()) {
mustache.execute(writer, versionInfo).flush();
}
note("Generated source: " + fileName + " (" + new File(jfo.getName()).getAbsoluteFile().getParent() + ')');
diff --git a/src/test/java/net/thauvin/erik/semver/ConstantsTest.java b/src/test/java/net/thauvin/erik/semver/ConstantsTest.java
index b407441..b6c2907 100644
--- a/src/test/java/net/thauvin/erik/semver/ConstantsTest.java
+++ b/src/test/java/net/thauvin/erik/semver/ConstantsTest.java
@@ -66,7 +66,7 @@ class ConstantsTest {
templates.add(Constants.DEFAULT_KOTLIN_TEMPLATE);
templates.add(Constants.DEFAULT_TEMPLATE_NAME);
- for (final var tp : templates) {
+ for (final String tp : templates) {
assertTrue(tp.endsWith(".mustache"), tp);
}
}
diff --git a/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java b/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java
index 5a05f69..ad3b742 100644
--- a/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java
+++ b/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java
@@ -32,16 +32,13 @@
package net.thauvin.erik.semver;
-import com.github.mustachejava.Mustache;
import org.junit.jupiter.api.Test;
-import java.io.File;
-import java.io.IOException;
-import java.io.StringWriter;
import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.util.Properties;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* The version.properties
, version.mustache
) must be
specified using the semver.project.dir
processor
diff --git a/examples/java/bld/.idea/app.iml b/examples/java/bld/.idea/app.iml
index 082bb1c..787b59b 100644
--- a/examples/java/bld/.idea/app.iml
+++ b/examples/java/bld/.idea/app.iml
@@ -9,7 +9,6 @@
- *
- */
public class ExampleBuild extends Project {
public ExampleBuild() {
pkg = "com.example";
@@ -29,29 +20,16 @@ public class ExampleBuild extends Project {
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL);
- scope(compile).include(dependency("net.thauvin.erik", "semver", version(1, 2, 1, "SNAPSHOT")));
+ scope(compile)
+ .include(dependency("net.thauvin.erik", "semver", version(1, 2, 1, "SNAPSHOT")));
+ }
+
+ @BuildCommand(summary = "Run the example")
+ public void runExample() throws Exception {
+ runOperation().executeOnce(() -> runOperation().fromProject(this).mainClass("com.example.Example"));
}
public static void main(String[] args) {
new ExampleBuild().start(args);
}
-
- /**
- * Saves generated source files in the {@code build/generated} directory.
- * VersionProcessorTest
class.
@@ -52,99 +49,29 @@ import static org.junit.jupiter.api.Assertions.*;
*/
class VersionProcessorTest {
private final VersionProcessor processor = new VersionProcessor();
- private final VersionTest version = new VersionTest();
-
- @SuppressWarnings("PMD.AvoidAccessibilityAlteration")
- @Test
- void testCompileTemplate()
- throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, IOException {
- final var method = processor.getClass().getDeclaredMethod("compileTemplate", File.class, String.class);
- method.setAccessible(true);
-
- final var mustache = (Mustache) method.invoke(processor, new File("src/main/resources"),
- Constants.DEFAULT_JAVA_TEMPLATE);
-
- assertEquals(Constants.DEFAULT_JAVA_TEMPLATE, mustache.getName(), Constants.DEFAULT_JAVA_TEMPLATE);
-
- try (var writer = new StringWriter()) {
- mustache.execute(writer, version).flush();
- assertEquals(String.format("""
- /*
- * This file is automatically generated.
- * Do not modify! -- ALL CHANGES WILL BE ERASED!
- */
-
- package %s;
-
- import java.util.Date;
-
- /**
- * Provides semantic version information.
- *
- * @author Semantic Version Annotation Processor
- */
- public final class MyTest {
- public static final String PROJECT = "%s";
- public static final Date BUILDDATE = new Date(L);
- public static final int MAJOR = %d;
- public static final int MINOR = %d;
- public static final int PATCH = %d;
- public static final String PRERELEASE = "%s";
- public static final String PRERELEASE_PREFIX = "%s";
- public static final String BUILDMETA = "%s";
- public static final String BUILDMETA_PREFIX = "%s";
- public static final String SEPARATOR = "%s";
- public static final String VERSION = "";
-
- /**
- * Disables the default constructor.
- */
- private MyTest() {
- throw new UnsupportedOperationException("Illegal constructor call.");
- }
- }
- """, version.packageName(), version.project(), version.major(), version.minor(), version.patch(),
- version.preRelease(), version.preReleasePrefix(), version.buildMeta(),
- version.buildMetaPrefix(), version.separator()),
- writer.toString());
- }
- }
+ private final Version version = new VersionTest();
@SuppressWarnings("PMD.AvoidAccessibilityAlteration")
@Test
void testFindValues() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
- final var method = processor.getClass().getDeclaredMethod("findValues", Version.class);
+ final Method method = processor.getClass().getDeclaredMethod("findValues", Version.class);
method.setAccessible(true);
- final var versionInfo = (VersionInfo) method.invoke(processor, version);
+ final VersionInfo versionInfo = (VersionInfo) method.invoke(processor, version);
assertEquals("0-0-7:vodka++martini", versionInfo.getVersion(), "getVersion(0-0-7:vodka++martin)");
assertEquals("James Bond", versionInfo.getProject(), "getProject(James Bond)");
}
- @SuppressWarnings("PMD.AvoidAccessibilityAlteration")
- @Test
- void testGetTemplate() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
- final var method = processor.getClass().getDeclaredMethod("getTemplate", boolean.class, Version.class);
- method.setAccessible(true);
-
- assertEquals(version.template(), method.invoke(processor, true, version), version.template);
- version.setTemplate(Constants.DEFAULT_JAVA_TEMPLATE);
- assertEquals(Constants.DEFAULT_TEMPLATE_NAME, method.invoke(processor, true, version),
- "default");
- assertEquals(Constants.DEFAULT_KOTLIN_TEMPLATE, method.invoke(processor, false, version),
- "kotlin");
- }
-
@SuppressWarnings("PMD.AvoidAccessibilityAlteration")
@Test
void testParseIntProperty() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
- final var p = new Properties();
+ final Properties p = new Properties();
p.setProperty("1", "1");
p.setProperty("2", "2.1");
p.setProperty("3", "zero");
p.setProperty("4", " 4 ");
- final var method = processor.getClass().getDeclaredMethod("parseIntProperty", Properties.class, String.class,
+ final Method method = processor.getClass().getDeclaredMethod("parseIntProperty", Properties.class, String.class,
int.class);
method.setAccessible(true);
diff --git a/src/test/java/net/thauvin/erik/semver/VersionTest.java b/src/test/java/net/thauvin/erik/semver/VersionTest.java
index e14f359..0153b1d 100644
--- a/src/test/java/net/thauvin/erik/semver/VersionTest.java
+++ b/src/test/java/net/thauvin/erik/semver/VersionTest.java
@@ -43,8 +43,6 @@ import java.lang.annotation.Annotation;
*/
@SuppressWarnings({"ClassExplicitlyAnnotation", "SameReturnValue", "java:S2187", "PMD.TestClassWithoutTestCases"})
class VersionTest implements Version {
- String template = "myversion.mustache";
-
@Override
public Class extends Annotation> annotationType() {
return null;
@@ -162,15 +160,11 @@ class VersionTest implements Version {
@Override
public String template() {
- return template;
+ return "myversion.mustache";
}
@Override
public String type() {
return "kt";
}
-
- public void setTemplate(final String template) {
- this.template = template;
- }
}