te4j

Fast, lightweight and easy template engine

Лицензия

Лицензия

Группа

Группа

com.github.lero4ka16
Идентификатор

Идентификатор

te4j
Последняя версия

Последняя версия

2.0.0
Дата

Дата

Тип

Тип

pom.sha512
Описание

Описание

te4j
Fast, lightweight and easy template engine
Ссылка на сайт

Ссылка на сайт

https://github.com/lero4ka16/te4j
Организация-разработчик

Организация-разработчик

com.github.lero4ka16
Система контроля версий

Система контроля версий

https://github.com/lero4ka16/te4j

Скачать te4j

Имя Файла Размер
te4j-2.0.0.pom
te4j-2.0.0-sources.jar 88 KB
te4j-2.0.0-javadoc.jar 333 KB
Обзор

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Te4j

About the project

Te4j (Template Engine For Java) - Fastest and easy template engine

Pros

  • Extremely fast (132k renders per second on 4790K)
  • Easy and simple syntax
  • No dependencies

Cons (temporary)

  • No community :(
  • Sometimes really bad code
  • No javadocs
  • Poor documentation

Benchmarks

Click me

Example

<p>Message: ^^ message ^^</p>
class Pojo {
    String getMessage() {
        return "Hello world!";
    }
}

Pojo pojo = new Pojo();

Template<Pojo> template = Te4j.load(Pojo.class).from("index.html");
String result = template.renderAsString(pojo);
// result = <p>Message: Hello world!</p>

Also, you are able to create custom template context

TemplateContext ctx = Te4j.custom()
        // deletes repeating spaces, tabs, crlf from output
        .minify(Minify.DEL_CF, Minify.DEL_LF, Minify.DEL_TABS, Minify.DEL_REPEATING_SPACES)
        // .minify(Minify.getValues())
        // .minifyAll()

        // you can choose which output type will be used
        //
        // BYTES - renderAsBytes and renderTo will be optimized
        // STRING - renderAsString will be optimized
        .output(Output.BYTES, Output.STRING)
        // .output(Output.getValues())
        // .outputAll()

        // btw you can enable hot reloading
        //
        // it does not impact performance,
        // but I recommend disabling it in production
        // for max. performance
        .enableAutoReloading()
        .build();

Template<Pojo> template = ctx.load(Pojo.class).from("index.html");

More examples in docs

Full Docs

Click me

Add as dependency

Maven

<dependencies>
    <dependency>
        <groupId>com.github.lero4ka16</groupId>
        <artifactId>te4j</artifactId>
        <version>2.0.0</version>
    </dependency>
</dependencies>

Gradle

dependencies {
    implementation 'com.github.lero4ka16:te4j:2.0.0'
}

Build the project

  1. Execute ./gradlew build
  2. Output file located at build/libs/te4j.jar

Contact

Vkontakte, Telegram

Post Scriptum

I will be very glad if someone can help me with development.

Версии библиотеки

Версия
2.0.0
1.1.1
1.1.0
1.0.0