/datex-client

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

Primary LanguageJavaMIT LicenseMIT

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?

The stable release are published to the Bintray JCentral Repo.

Maven

<repository>
  <id>jcenter</id>
  <url>http://jcenter.bintray.com/</url>
</repository>
<!-- ... -->
<dependency>
  <groupId>no.vegvesen</groupId>
  <artifactId>datex-client</artifactId>
  <version>1.0</version>
</dependency>

Gradle

  //core
  implementation 'no.vegvesen:datex-client:1.0'

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.