This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
netex-java-model is a Java library that generates JAXB model classes from NeTEx (Network Timetable Exchange) XML Schema Definition (XSD) files. The XSD files are downloaded from https://github.com/entur/NeTEx and compiled into Java classes at build time.
- Organization: Entur AS (Norwegian public transport data provider)
- License: EUPL-1.2
- Java Version: 11+ (builds on 17 in CI)
- Package:
org.rutebanken.netex.model(generated),org.rutebanken.netexandorg.rutebanken.util(source)
# Full build (downloads XSD, generates JAXB classes, compiles, tests)
mvn clean install
# Run tests only
mvn test
# Package without tests
mvn package -DskipTests
# Validate build setup
mvn validatePrerequisites: xmlstarlet must be installed (apt install xmlstarlet on Debian/Ubuntu).
├── bin/ # Build scripts
│ ├── netex-download-extract.sh # Downloads NeTEx XSD from GitHub
│ ├── annotation-replacer.sh # Post-processes generated Java files
│ └── version_updater.sh # Updates version references
├── bindings.xjb # JAXB customization bindings
├── src/main/java/org/rutebanken/
│ ├── netex/ # Utilities (validation, client, toString style)
│ └── util/ # XML adapters for Java 8 time types
├── src/main/resources/xsd/ # NeTEx XSD files (downloaded at build time)
├── src/test/ # JUnit 5 tests for marshalling/unmarshalling
└── target/generated-sources/ # JAXB-generated model classes (build artifact)
-
JAXB Bindings: The
bindings.xjbfile customizes code generation, including:- Java 8 time type adapters (
LocalDateTime,LocalTime,Duration) - Property name conflict resolution
- Package naming (
org.rutebanken.netex.model)
- Java 8 time type adapters (
-
Generated Code: Model classes are generated in
target/generated-sources/during build. Do not manually edit generated code. -
NeTEx Version: Configured in
pom.xmlvia<netexVersion>property (currently 1.16). -
Validation:
NeTExValidatorclass provides XML schema validation against NeTEx XSD.
GitHub Actions workflows in .github/workflows/:
deploy.yml: Main build, test, Sonar scan, and snapshot publishing- Release workflows: GitFlow-based release management
- Publishes to Maven Central via JReleaser
Tests verify JAXB marshalling/unmarshalling of various NeTEx frame types:
MarshalUnmarshalTest- Round-trip serializationUnmarshalServiceFrameTest,UnmarshalSiteFrameTest, etc. - Frame-specific testsNeTExValidatorTest- Schema validation tests