From 676dd5c95412a8660249261af2921d4975f44bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Erik=20St=C3=B8wer?= Date: Mon, 23 Oct 2023 10:15:50 +0200 Subject: [PATCH 1/3] Update netex java model 1.15 --- pom.xml | 2 +- .../netex/loader/parser/ServiceFrameParser.java | 4 ++-- .../netex/loader/parser/SiteFrameParser.java | 16 +++++++++------- .../loader/parser/TimeTableFrameParser.java | 1 - 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 2556460..cf7dca2 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ UTF-8 1.8 - 1.0.14 + 1.0.15-20231018.113113-5 32.0.0-jre 1.6.12 diff --git a/src/main/java/org/entur/netex/loader/parser/ServiceFrameParser.java b/src/main/java/org/entur/netex/loader/parser/ServiceFrameParser.java index 3eb8856..9c96933 100644 --- a/src/main/java/org/entur/netex/loader/parser/ServiceFrameParser.java +++ b/src/main/java/org/entur/netex/loader/parser/ServiceFrameParser.java @@ -160,12 +160,12 @@ private void parseStopAssignments(StopAssignmentsInFrame_RelStructure stopAssign passengerStopAssignmentByStopPointRef.put(stopPointRef, assignment); if (assignment.getQuayRef() != null) { - String quayRef = assignment.getQuayRef().getRef(); + String quayRef = assignment.getQuayRef().getValue().getRef(); quayIdByStopPointRef.put(stopPointRef, quayRef); } if (assignment.getStopPlaceRef() != null) { - String stopPlaceRef = assignment.getStopPlaceRef().getRef(); + String stopPlaceRef = assignment.getStopPlaceRef().getValue().getRef(); stopPlaceIdByStopPointRef.put(stopPointRef, stopPlaceRef); } } diff --git a/src/main/java/org/entur/netex/loader/parser/SiteFrameParser.java b/src/main/java/org/entur/netex/loader/parser/SiteFrameParser.java index 990f98f..beedf20 100644 --- a/src/main/java/org/entur/netex/loader/parser/SiteFrameParser.java +++ b/src/main/java/org/entur/netex/loader/parser/SiteFrameParser.java @@ -11,6 +11,7 @@ import org.rutebanken.netex.model.Quay; import org.rutebanken.netex.model.Quays_RelStructure; import org.rutebanken.netex.model.Site_VersionFrameStructure; +import org.rutebanken.netex.model.Site_VersionStructure; import org.rutebanken.netex.model.StopPlace; import org.rutebanken.netex.model.TariffZone; import org.rutebanken.netex.model.TopographicPlace; @@ -51,7 +52,7 @@ class SiteFrameParser extends NetexParser { @Override public void parse(Site_VersionFrameStructure frame) { if (frame.getStopPlaces() != null) { - parseStopPlaces(frame.getStopPlaces().getStopPlace()); + parseStopPlaces(frame.getStopPlaces().getStopPlace_()); } if (frame.getGroupsOfStopPlaces() != null) { @@ -118,8 +119,9 @@ private void parseGroupsOfStopPlaces(Collection groupsOfStopP groupsOfStopPlaces.addAll(groupsOfStopPlacesList); } - private void parseStopPlaces(Collection stopPlaceList) { - for (StopPlace stopPlace : stopPlaceList) { + private void parseStopPlaces(List> stopPlaceList) { + for (JAXBElement jaxbStopPlace : stopPlaceList) { + StopPlace stopPlace = (StopPlace) jaxbStopPlace.getValue(); stopPlaces.add(stopPlace); if (!isMultiModalStopPlace(stopPlace)) { parseQuays(stopPlace.getQuays(), stopPlace.getId()); @@ -158,9 +160,9 @@ private void parseParkings(Collection parkingList) { private void parseQuays(Quays_RelStructure quayRefOrQuay, String stopPlaceId) { if (quayRefOrQuay == null) return; - for (Object quayObject : quayRefOrQuay.getQuayRefOrQuay()) { - if (quayObject instanceof Quay) { - Quay quay = (Quay) quayObject; + for (JAXBElement jaxbQuay : quayRefOrQuay.getQuayRefOrQuay()) { + if (jaxbQuay.getValue() instanceof Quay) { + Quay quay = (Quay) jaxbQuay.getValue(); String quayId = quay.getId(); quays.put(quayId, quay); if (!stopPlaceIdByQuayId.containsKey(quayId)) { @@ -168,7 +170,7 @@ private void parseQuays(Quays_RelStructure quayRefOrQuay, String stopPlaceId) { } else if (!stopPlaceIdByQuayId.get(quayId).equals(stopPlaceId)) { // the Quay has been moved to another StopPlace. The latest version of the Quay is used for updating the Map (quay id --> stop place id) Quay latestVersion = NetexVersionHelper.latestVersionedElementIn(quays.get(quayId)); - if (quayObject.equals(latestVersion)) { + if (jaxbQuay.getValue().equals(latestVersion)) { stopPlaceIdByQuayId.put(quayId, stopPlaceId); } } diff --git a/src/main/java/org/entur/netex/loader/parser/TimeTableFrameParser.java b/src/main/java/org/entur/netex/loader/parser/TimeTableFrameParser.java index bd7144b..071a38b 100644 --- a/src/main/java/org/entur/netex/loader/parser/TimeTableFrameParser.java +++ b/src/main/java/org/entur/netex/loader/parser/TimeTableFrameParser.java @@ -48,7 +48,6 @@ void parse(Timetable_VersionFrameStructure frame) { // Keep list sorted alphabetically informOnElementIntentionallySkipped(LOG, frame.getBookingTimes()); - informOnElementIntentionallySkipped(LOG, frame.getVehicleTypeRef()); informOnElementIntentionallySkipped(LOG, frame.getCoupledJourneys()); informOnElementIntentionallySkipped(LOG, frame.getDefaultInterchanges()); informOnElementIntentionallySkipped(LOG, frame.getFlexibleServiceProperties()); From 8ced3af9cda8ad0c68b9b1238ffdbebe7e62d93e Mon Sep 17 00:00:00 2001 From: Vincent Paturet Date: Wed, 1 Nov 2023 10:19:45 +0100 Subject: [PATCH 2/3] Update NeTEx 1.15 final --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cf7dca2..7eebe0c 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ UTF-8 1.8 - 1.0.15-20231018.113113-5 + 1.0.15 32.0.0-jre 1.6.12 From 7dc3ee87ea45524fb4a4abbd946e52aab9f7515d Mon Sep 17 00:00:00 2001 From: Vincent Paturet Date: Wed, 1 Nov 2023 10:25:30 +0100 Subject: [PATCH 3/3] Bump minor version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7eebe0c..9ea8d65 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.entur netex-parser-java - 2.2.1-SNAPSHOT + 2.3.0-SNAPSHOT netex-java-parser Library for parsing NeTEx files and looking up entities in an index.