Skip to content

This is an EFX translator written in Java. It supports multiple target languages. It includes an EFX expression translator to XPath. It is used to in the generation of the Schematron rules in the eForms SDK.

License

Notifications You must be signed in to change notification settings

OP-TED/efx-toolkit-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 Latest Release Notes | 📦 Latest Release Artifacts


Java toolkit for the eForms Expression Language (EFX)

The EFX Toolkit1 for Java developers is a library that enables the transpilation of EFX expressions and templates to different target languages. It also provides an implementation for translating EFX expressions to XPath.

The documentation is available at: https://docs.ted.europa.eu/eforms/latest/efx-toolkit

Using the EFX toolkit1

The EFX toolkit requires Java 11 or later.

It is available as a Maven package on Maven Central and can be used by adding the following to the project's pom.xml.

<dependencies>
  ...
  <dependency>
    <groupId>eu.europa.ted.eforms</groupId>
    <artifactId>efx-toolkit-java</artifactId>
    <version>${efx-toolkit.version}</version>
  </dependency>
  ...
</dependencies>

Replace ${efx-toolkit.version} with the latest version available, or define the corresponding property in your pom.xml.

The documentation describes the capabilities of the library, and the interfaces you might need to implement.

Building

You can build this project as usual using Maven.

The build process uses the grammar files provided in the eForms SDK to generate a parser, using ANTLR4.

In order to be able to use snapshot versions of dependencies, the following should be added to the "profiles" section of the Maven configuration file "settings.xml" (normally under ${HOME}/.m2):

<servers>
  <server>
    <id>ossrh</id>
    <username>${env.MAVEN_USERNAME}</username>
    <password>${env.MAVEN_PASSWORD}</password>
  </server>
</servers>

<profile>
  <id>repositories</id>
  <activation>
    <activeByDefault>true</activeByDefault>
  </activation>
  <repositories>
    <repository>
      <id>ossrh</id>
      <name>OSSRH Snapshots</name>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
</profile>

See ".github/workflows/settings.xml".

Testing

Unit tests are available under src/test/java/. They show in particular a variety of EFX expressions and the corresponding XPath expression.

After running the unit tests with mvn test, you can generate a coverage report with mvn jacoco:report. The report is available under target/site/jacoco/, in HTML, CSV, and XML format.

Download

You can download the latest EFX Toolkit from Maven Central.

Maven Central

Footnotes

  1. Copyright 2022 European Union
    Licensed under the EUPL, Version 1.2 or – as soon they will be approved by the European Commission – subsequent versions of the EUPL (the "Licence"); You may not use this work except in compliance with the Licence. You may obtain a copy of the Licence here.
    Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licence for the specific language governing permissions and limitations under the Licence. 2

About

This is an EFX translator written in Java. It supports multiple target languages. It includes an EFX expression translator to XPath. It is used to in the generation of the Schematron rules in the eForms SDK.

Topics

Resources

License

Stars

Watchers

Forks

Languages