velocity

Laconic API for Apache Velocity

Лицензия

Лицензия

${project.licence}
Группа

Группа

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

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

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

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

0.4.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

velocity
Laconic API for Apache Velocity
Ссылка на сайт

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

http://github.com/dgroup/velocity
Система контроля версий

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

http://github.com/dgroup/velocity/tree/master

Скачать velocity

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.dgroup/velocity/ -->
<dependency>
    <groupId>com.github.dgroup</groupId>
    <artifactId>velocity</artifactId>
    <version>0.4.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.dgroup/velocity/
implementation 'com.github.dgroup:velocity:0.4.0'
// https://jarcasting.com/artifacts/com.github.dgroup/velocity/
implementation ("com.github.dgroup:velocity:0.4.0")
'com.github.dgroup:velocity:jar:0.4.0'
<dependency org="com.github.dgroup" name="velocity" rev="0.4.0">
  <artifact name="velocity" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.dgroup', module='velocity', version='0.4.0')
)
libraryDependencies += "com.github.dgroup" % "velocity" % "0.4.0"
[com.github.dgroup/velocity "0.4.0"]

Зависимости

provided (2)

Идентификатор библиотеки Тип Версия
org.cactoos : cactoos jar 0.37
org.apache.velocity : velocity jar 1.7

test (4)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
com.tngtech.junit.dataprovider : junit4-dataprovider jar 2.0
org.hamcrest : hamcrest-all jar 1.3
org.assertj : assertj-core jar 3.8.0

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

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

Maven Javadocs License: MIT Commit activity Hits-of-Code

Build Status 0pdd Dependency Status Known Vulnerabilities

DevOps By Rultor.com EO badge We recommend IntelliJ IDEA

Qulice SQ passed Codebeat Codacy Badge Codecov

ATTENTION: We're still in a very early alpha version, the API may and will change frequently. Please, use it at your own risk, until we release version 1.0.

Maven:

<dependency>
    <groupId>com.github.dgroup</groupId>
    <artifactId>laconic-velocity</artifactId>
</dependency>

Gradle:

dependencies {
    compile 'com.github.dgroup:laconic-velocity:<version>'
}

Get started

Generate the text/sql/xml/markdown/json/etc based on Apache Velocity template.

  1. Define velocity template query.sql
    select 1 from dual
    #if ($flag)
    union
    select 2 from dual
    #end
    in
    velocity $ tree
    ...
    |-- src
    |   |-- main
    |   |   |-- ...
    |   |
    |   `-- test
    |       |-- java
    |       |   `-- ...
    |       `-- resources
    |           `-- velocity
    |               |-- ...
    |               |-- query.sql
    |               |-- ...
    ...
    
    
  2. Define instance of velocity template using
    • full path to template
      @Test
      public void transformSql() throws TemplateException {
          MatcherAssert.assertThat(
              new Text("query.sql", "src/test/resources/velocity").compose(
                  new ArgOf("flag", true)
              ),
              Matchers.equalTo(
                  "select 1 from dual\nunion\nselect 2 from dual\n"
              )
          );
      }
      See more.
    • hierarchical search
      @Test
      public void hierarchical() throws TemplateException {
          MatcherAssert.assertThat(
              new Text("query.sql", "src/test/resources").compose(
                  new ArgOf("flag", true)
              ),
              Matchers.equalTo(
                  "select 1 from dual\nunion\nselect 2 from dual\n"
              )
          );
      }
      You can also specify the multiple roots (more).
    • classpath template
      @Test
      public void classpath() throws TemplateException {
          MatcherAssert.assertThat(
              new Text(new RelativePath("velocity/query.sql")).compose(
                  new ArgOf("flag", true)
              ),
              Matchers.equalTo(
                  "select 1 from dual\nunion\nselect 2 from dual\n"
              )
          );
      }
      See more.

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

Версия
0.4.0
0.3.0
0.2.0
0.1.0