This repo will be deleted end of March 2022 . Further development is moved to https://github.com/svvsaga/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/.
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
- 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.
- Use the DatexSerializer class
D2LogicalModel model = new DatexSerializer().deserialize(InputStream stream)
, see more example tests
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:
<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>
repositories {
...
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.vegvesen:datex-client:1.2.0'
}
- Bump the
artifactVersion
inbuild.gradle.kts
- Run
./gradlew githubRelease
- Clone repo
- Install Gradle
- Run
gradle test
Yes! PRs are welcome.
datex-client is released under the MIT license.