From 80736d28f92c265dec9fa69cc59e0bd49c009550 Mon Sep 17 00:00:00 2001 From: Jingsi Lu Date: Tue, 15 Oct 2024 11:19:06 -0400 Subject: [PATCH] applied @NoInvalidCharacters to String fields --- .../gtfsvalidator/table/GtfsAreaSchema.java | 7 ++----- .../gtfsvalidator/table/GtfsAttributionSchema.java | 3 +++ .../table/GtfsBookingRulesSchema.java | 14 +++++++------- .../gtfsvalidator/table/GtfsFareMediaSchema.java | 7 ++----- .../gtfsvalidator/table/GtfsFareProductSchema.java | 12 +++--------- .../gtfsvalidator/table/GtfsFeedInfoSchema.java | 5 +++++ .../table/GtfsLocationGroupsSchema.java | 8 ++------ .../gtfsvalidator/table/GtfsNetworkSchema.java | 1 + .../gtfsvalidator/table/GtfsPathwaySchema.java | 2 ++ .../gtfsvalidator/table/GtfsRouteSchema.java | 2 ++ .../gtfsvalidator/table/GtfsStopSchema.java | 6 ++++++ .../gtfsvalidator/table/GtfsStopTimeSchema.java | 14 ++------------ .../gtfsvalidator/table/GtfsTranslationSchema.java | 11 ++++++----- .../gtfsvalidator/table/GtfsTripSchema.java | 2 ++ 14 files changed, 45 insertions(+), 49 deletions(-) diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsAreaSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsAreaSchema.java index 9dfa9ff520..d903cf5611 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsAreaSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsAreaSchema.java @@ -16,11 +16,7 @@ package org.mobilitydata.gtfsvalidator.table; -import org.mobilitydata.gtfsvalidator.annotation.FieldType; -import org.mobilitydata.gtfsvalidator.annotation.FieldTypeEnum; -import org.mobilitydata.gtfsvalidator.annotation.GtfsTable; -import org.mobilitydata.gtfsvalidator.annotation.PrimaryKey; -import org.mobilitydata.gtfsvalidator.annotation.Required; +import org.mobilitydata.gtfsvalidator.annotation.*; @GtfsTable( value = "areas.txt", @@ -35,5 +31,6 @@ public interface GtfsAreaSchema extends GtfsEntity { @PrimaryKey String areaId(); + @NoInvalidCharacters String areaName(); } diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsAttributionSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsAttributionSchema.java index aadd175d07..9550501eb9 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsAttributionSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsAttributionSchema.java @@ -47,11 +47,14 @@ public interface GtfsAttributionSchema extends GtfsEntity { GtfsAttributionRole isAuthority(); @FieldType(FieldTypeEnum.URL) + @NoInvalidCharacters String attributionUrl(); @FieldType(FieldTypeEnum.EMAIL) + @NoInvalidCharacters String attributionEmail(); @FieldType(FieldTypeEnum.PHONE_NUMBER) + @NoInvalidCharacters String attributionPhone(); } diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsBookingRulesSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsBookingRulesSchema.java index 44973c2647..25fc56bbc8 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsBookingRulesSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsBookingRulesSchema.java @@ -1,12 +1,6 @@ package org.mobilitydata.gtfsvalidator.table; -import org.mobilitydata.gtfsvalidator.annotation.ConditionallyRequired; -import org.mobilitydata.gtfsvalidator.annotation.FieldType; -import org.mobilitydata.gtfsvalidator.annotation.FieldTypeEnum; -import org.mobilitydata.gtfsvalidator.annotation.GtfsTable; -import org.mobilitydata.gtfsvalidator.annotation.MixedCase; -import org.mobilitydata.gtfsvalidator.annotation.PrimaryKey; -import org.mobilitydata.gtfsvalidator.annotation.Required; +import org.mobilitydata.gtfsvalidator.annotation.*; import org.mobilitydata.gtfsvalidator.type.GtfsTime; @GtfsTable("booking_rules.txt") @@ -41,20 +35,26 @@ public interface GtfsBookingRulesSchema extends GtfsEntity { String priorNoticeServiceId(); @MixedCase + @NoInvalidCharacters String message(); @MixedCase + @NoInvalidCharacters String pickupMessage(); @MixedCase + @NoInvalidCharacters String dropOffMessage(); @FieldType(FieldTypeEnum.PHONE_NUMBER) + @NoInvalidCharacters String phoneNumber(); @FieldType(FieldTypeEnum.URL) + @NoInvalidCharacters String infoUrl(); @FieldType(FieldTypeEnum.URL) + @NoInvalidCharacters String bookingUrl(); } diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFareMediaSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFareMediaSchema.java index bb90615681..a38867f2bc 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFareMediaSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFareMediaSchema.java @@ -1,10 +1,6 @@ package org.mobilitydata.gtfsvalidator.table; -import org.mobilitydata.gtfsvalidator.annotation.FieldType; -import org.mobilitydata.gtfsvalidator.annotation.FieldTypeEnum; -import org.mobilitydata.gtfsvalidator.annotation.GtfsTable; -import org.mobilitydata.gtfsvalidator.annotation.PrimaryKey; -import org.mobilitydata.gtfsvalidator.annotation.Required; +import org.mobilitydata.gtfsvalidator.annotation.*; @GtfsTable("fare_media.txt") public interface GtfsFareMediaSchema extends GtfsEntity { @@ -13,6 +9,7 @@ public interface GtfsFareMediaSchema extends GtfsEntity { @Required String fareMediaId(); + @NoInvalidCharacters String fareMediaName(); @Required diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFareProductSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFareProductSchema.java index 3da1d0b537..5d96d5e301 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFareProductSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFareProductSchema.java @@ -20,15 +20,8 @@ import java.math.BigDecimal; import java.util.Currency; -import org.mobilitydata.gtfsvalidator.annotation.CurrencyAmount; -import org.mobilitydata.gtfsvalidator.annotation.FieldType; -import org.mobilitydata.gtfsvalidator.annotation.FieldTypeEnum; -import org.mobilitydata.gtfsvalidator.annotation.ForeignKey; -import org.mobilitydata.gtfsvalidator.annotation.GtfsTable; -import org.mobilitydata.gtfsvalidator.annotation.Index; -import org.mobilitydata.gtfsvalidator.annotation.NonNegative; -import org.mobilitydata.gtfsvalidator.annotation.PrimaryKey; -import org.mobilitydata.gtfsvalidator.annotation.Required; + +import org.mobilitydata.gtfsvalidator.annotation.*; @GtfsTable("fare_products.txt") public interface GtfsFareProductSchema extends GtfsEntity { @@ -38,6 +31,7 @@ public interface GtfsFareProductSchema extends GtfsEntity { @Index String fareProductId(); + @NoInvalidCharacters String fareProductName(); @Required diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFeedInfoSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFeedInfoSchema.java index b98f1df2fd..4be9348995 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFeedInfoSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFeedInfoSchema.java @@ -24,10 +24,12 @@ @ConditionallyRequired public interface GtfsFeedInfoSchema extends GtfsEntity { @Required + @NoInvalidCharacters String feedPublisherName(); @Required @FieldType(FieldTypeEnum.URL) + @NoInvalidCharacters String feedPublisherUrl(); @Required @@ -43,11 +45,14 @@ public interface GtfsFeedInfoSchema extends GtfsEntity { GtfsDate feedEndDate(); @Recommended + @NoInvalidCharacters String feedVersion(); @FieldType(FieldTypeEnum.EMAIL) + @NoInvalidCharacters String feedContactEmail(); @FieldType(FieldTypeEnum.URL) + @NoInvalidCharacters String feedContactUrl(); } diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsLocationGroupsSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsLocationGroupsSchema.java index e3f035037f..8382b28417 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsLocationGroupsSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsLocationGroupsSchema.java @@ -1,11 +1,6 @@ package org.mobilitydata.gtfsvalidator.table; -import org.mobilitydata.gtfsvalidator.annotation.FieldType; -import org.mobilitydata.gtfsvalidator.annotation.FieldTypeEnum; -import org.mobilitydata.gtfsvalidator.annotation.GtfsTable; -import org.mobilitydata.gtfsvalidator.annotation.MixedCase; -import org.mobilitydata.gtfsvalidator.annotation.PrimaryKey; -import org.mobilitydata.gtfsvalidator.annotation.Required; +import org.mobilitydata.gtfsvalidator.annotation.*; @GtfsTable("location_groups.txt") public interface GtfsLocationGroupsSchema extends GtfsEntity { @@ -15,5 +10,6 @@ public interface GtfsLocationGroupsSchema extends GtfsEntity { String locationGroupId(); @MixedCase + @NoInvalidCharacters String locationGroupName(); } diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsNetworkSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsNetworkSchema.java index 9696cadb50..200154f12a 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsNetworkSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsNetworkSchema.java @@ -10,5 +10,6 @@ public interface GtfsNetworkSchema extends GtfsEntity { String networkId(); @MixedCase + @NoInvalidCharacters String networkName(); } diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsPathwaySchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsPathwaySchema.java index a3c08a5e7d..a2bea4d3a6 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsPathwaySchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsPathwaySchema.java @@ -58,8 +58,10 @@ public interface GtfsPathwaySchema extends GtfsEntity { double minWidth(); @MixedCase + @NoInvalidCharacters String signpostedAs(); @MixedCase + @NoInvalidCharacters String reversedSignpostedAs(); } diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsRouteSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsRouteSchema.java index 3886cbbddc..ad9e69c33e 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsRouteSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsRouteSchema.java @@ -43,6 +43,7 @@ public interface GtfsRouteSchema extends GtfsEntity { String routeLongName(); @MixedCase + @NoInvalidCharacters String routeDesc(); @Required @@ -50,6 +51,7 @@ public interface GtfsRouteSchema extends GtfsEntity { GtfsRouteType routeType(); @FieldType(FieldTypeEnum.URL) + @NoInvalidCharacters String routeUrl(); @DefaultValue("FFFFFF") diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsStopSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsStopSchema.java index 67ec3c1537..fb053b867e 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsStopSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsStopSchema.java @@ -27,6 +27,7 @@ public interface GtfsStopSchema extends GtfsEntity { @Required String stopId(); + @NoInvalidCharacters String stopCode(); @MixedCase @@ -34,8 +35,10 @@ public interface GtfsStopSchema extends GtfsEntity { @NoInvalidCharacters String stopName(); + @NoInvalidCharacters String ttsStopName(); + @NoInvalidCharacters String stopDesc(); @FieldType(FieldTypeEnum.LATITUDE) @@ -52,6 +55,7 @@ public interface GtfsStopSchema extends GtfsEntity { String zoneId(); @FieldType(FieldTypeEnum.URL) + @NoInvalidCharacters String stopUrl(); GtfsLocationType locationType(); @@ -60,6 +64,7 @@ public interface GtfsStopSchema extends GtfsEntity { @Index @ConditionallyRequired @ForeignKey(table = "stops.txt", field = "stop_id") + @NoInvalidCharacters String parentStation(); @FieldType(FieldTypeEnum.TIMEZONE) @@ -71,5 +76,6 @@ public interface GtfsStopSchema extends GtfsEntity { @ForeignKey(table = "levels.txt", field = "level_id") String levelId(); + @NoInvalidCharacters String platformCode(); } diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsStopTimeSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsStopTimeSchema.java index 93a48fa614..9e16b08815 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsStopTimeSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsStopTimeSchema.java @@ -18,18 +18,7 @@ import static org.mobilitydata.gtfsvalidator.annotation.TranslationRecordIdType.RECORD_SUB_ID; -import org.mobilitydata.gtfsvalidator.annotation.CachedField; -import org.mobilitydata.gtfsvalidator.annotation.ConditionallyRequired; -import org.mobilitydata.gtfsvalidator.annotation.DefaultValue; -import org.mobilitydata.gtfsvalidator.annotation.EndRange; -import org.mobilitydata.gtfsvalidator.annotation.FieldType; -import org.mobilitydata.gtfsvalidator.annotation.FieldTypeEnum; -import org.mobilitydata.gtfsvalidator.annotation.ForeignKey; -import org.mobilitydata.gtfsvalidator.annotation.GtfsTable; -import org.mobilitydata.gtfsvalidator.annotation.Index; -import org.mobilitydata.gtfsvalidator.annotation.NonNegative; -import org.mobilitydata.gtfsvalidator.annotation.PrimaryKey; -import org.mobilitydata.gtfsvalidator.annotation.Required; +import org.mobilitydata.gtfsvalidator.annotation.*; import org.mobilitydata.gtfsvalidator.type.GtfsTime; @GtfsTable("stop_times.txt") @@ -70,6 +59,7 @@ public interface GtfsStopTimeSchema extends GtfsEntity { int stopSequence(); @CachedField + @NoInvalidCharacters String stopHeadsign(); GtfsTime startPickupDropOffWindow(); diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsTranslationSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsTranslationSchema.java index 140e58c0d1..e1fdf9aeff 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsTranslationSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsTranslationSchema.java @@ -19,22 +19,21 @@ import static org.mobilitydata.gtfsvalidator.annotation.TranslationRecordIdType.UNSUPPORTED; import java.util.Locale; -import org.mobilitydata.gtfsvalidator.annotation.CachedField; -import org.mobilitydata.gtfsvalidator.annotation.ConditionallyRequired; -import org.mobilitydata.gtfsvalidator.annotation.GtfsTable; -import org.mobilitydata.gtfsvalidator.annotation.PrimaryKey; -import org.mobilitydata.gtfsvalidator.annotation.Required; + +import org.mobilitydata.gtfsvalidator.annotation.*; @GtfsTable("translations.txt") public interface GtfsTranslationSchema extends GtfsEntity { @PrimaryKey(translationRecordIdType = UNSUPPORTED) @Required @CachedField + @NoInvalidCharacters String tableName(); @PrimaryKey(translationRecordIdType = UNSUPPORTED) @Required @CachedField + @NoInvalidCharacters String fieldName(); @PrimaryKey(translationRecordIdType = UNSUPPORTED) @@ -42,6 +41,7 @@ public interface GtfsTranslationSchema extends GtfsEntity { Locale language(); @Required + @NoInvalidCharacters String translation(); @PrimaryKey(translationRecordIdType = UNSUPPORTED) @@ -57,5 +57,6 @@ public interface GtfsTranslationSchema extends GtfsEntity { @PrimaryKey(translationRecordIdType = UNSUPPORTED) @ConditionallyRequired @CachedField + @NoInvalidCharacters String fieldValue(); } diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsTripSchema.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsTripSchema.java index 1357927c09..a06f1ea7bf 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsTripSchema.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsTripSchema.java @@ -38,9 +38,11 @@ public interface GtfsTripSchema extends GtfsEntity { String serviceId(); @MixedCase + @NoInvalidCharacters String tripHeadsign(); @MixedCase + @NoInvalidCharacters String tripShortName(); GtfsTripDirectionId directionId();