Skip to content

Commit

Permalink
Removing support for outdated SIRI-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
lassetyr committed Jan 7, 2025
1 parent 20c7609 commit 6fc51fa
Show file tree
Hide file tree
Showing 227 changed files with 4 additions and 52,105 deletions.
35 changes: 4 additions & 31 deletions src/main/java/org/entur/siri/validator/SiriValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

package org.entur.siri.validator;

import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Unmarshaller;
import org.entur.siri.UnsupportedSiriVersionException;
import org.xml.sax.SAXException;

import javax.xml.XMLConstants;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Unmarshaller;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import java.io.PrintStream;
Expand All @@ -30,9 +30,6 @@

public class SiriValidator {

private static JAXBContext siri10jaxbContext;
private static JAXBContext siri13jaxbContext;
private static JAXBContext siri14jaxbContext;
private static JAXBContext siri20jaxbContext;
private static JAXBContext siri21jaxbContext;

Expand All @@ -45,15 +42,6 @@ public class SiriValidator {
}

private static void init() throws JAXBException {
if (siri10jaxbContext == null) {
siri10jaxbContext = JAXBContext.newInstance(uk.org.siri.siri10.Siri.class);
}
if (siri13jaxbContext == null) {
siri13jaxbContext = JAXBContext.newInstance(uk.org.siri.siri13.Siri.class);
}
if (siri14jaxbContext == null) {
siri14jaxbContext = JAXBContext.newInstance(uk.org.siri.siri14.Siri.class);
}
if (siri20jaxbContext == null) {
siri20jaxbContext = JAXBContext.newInstance(uk.org.siri.siri20.Siri.class);
}
Expand Down Expand Up @@ -137,12 +125,6 @@ public static boolean validate(String xml, Version version, PrintStream out) thr

private static Unmarshaller getVersionSpecificUnmarshaller(Version version) throws JAXBException {
switch (version) {
case VERSION_1_0:
return siri10jaxbContext.createUnmarshaller();
case VERSION_1_3:
return siri13jaxbContext.createUnmarshaller();
case VERSION_1_4:
return siri14jaxbContext.createUnmarshaller();
case VERSION_2_0:
return siri20jaxbContext.createUnmarshaller();
case VERSION_2_1:
Expand All @@ -156,15 +138,6 @@ private static URL getXsdRelativePath(Version version) {

String path;
switch (version) {
case VERSION_1_0:
path = "siri-1.0/xsd/siri.xsd";
break;
case VERSION_1_3:
path = "siri-1.3/xsd/siri.xsd";
break;
case VERSION_1_4:
path = "siri-1.4/xsd/siri.xsd";
break;
case VERSION_2_0:
path = "siri-2.0/xsd/siri.xsd";
break;
Expand All @@ -178,5 +151,5 @@ private static URL getXsdRelativePath(Version version) {
return SiriValidator.class.getClassLoader().getResource(path);
}

public enum Version {VERSION_1_0, VERSION_1_3, VERSION_1_4, VERSION_2_0, VERSION_2_1}
public enum Version {VERSION_2_0, VERSION_2_1}
}

This file was deleted.

158 changes: 0 additions & 158 deletions src/main/java/org/rutebanken/validator/SiriValidator.java

This file was deleted.

72 changes: 0 additions & 72 deletions src/main/resources/siri-1.0/xjb/jaxb-bindings.xml

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6fc51fa

Please sign in to comment.