Skip to content
This repository was archived by the owner on Aug 19, 2021. It is now read-only.

vegvesen/datex-client

Repository files navigation

This repo will be deleted end of March 2022 . Further development is moved to https://github.com/svvsaga/datex-client

datex-client

A simple serializer library which can deserialize Datex II publications from XML to JAXB POJOs. For more information on DATEX II see https://www.datex2.eu/.

How is it made?

JAXB-RI v 2.3.2 is used to generate POJOs from the official Datex II v 2.3 Schema

The following command is used to generate POJOs:

./xjc.sh -no-header -p eu.datex.v220 -npa https://datex2.eu/sites/default/files/DATEXIISchema_2_2_0_0.xsd

The top level entity is the D2LogicalModel. See the XML layout for an example Datex II publication

How can I use it?

  1. Point your favorite HTTP Client towards a Datex II publication endpoint. You can find a list of available of European Datex II nodes in the Datex II Node directory and a list of the publications available by the Norwegian Public Road Authority is made available with documentation.
  2. Use the DatexSerializer class D2LogicalModel model = new DatexSerializer().deserialize(InputStream stream), see more example tests

Where can I get it?

You can either (if using Gradle) reference the source code as a dependency, e.g. in your settings.gradle:

sourceControl {
    gitRepository("https://github.com/vegvesen/datex-client.git") {
        producesModule("no.vegvesen:datex-client")
    }
}

And then reference the needed tag in your build.gradle:

dependencies {
    implementation 'no.vegvesen:datex-client:1.2.0'
}

Or, you can use jitpack as a repository which will automatically build and download the dependency:

Maven

<repository>
  <id>jitpack</id>
  <url>https://jitpack.io</url>
</repository>
<!-- ... -->
<dependency>
  <groupId>com.github.vegvesen</groupId>
  <artifactId>datex-client</artifactId>
  <version>1.2.0</version>
</dependency>

Gradle

repositories {
    ...
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation 'com.github.vegvesen:datex-client:1.2.0'
}

How to create new releases

  1. Bump the artifactVersion in build.gradle.kts
  2. Run ./gradlew githubRelease

How can I run the tests

  1. Clone repo
  2. Install Gradle
  3. Run gradle test

Can I contribute?

Yes! PRs are welcome.

License

datex-client is released under the MIT license.

About

A serializer library which can deserialize Datex publications from XML to JAXB POJOs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •