Skip to content

Commit

Permalink
applied @NoInvalidCharacters to String fields
Browse files Browse the repository at this point in the history
  • Loading branch information
qcdyx committed Oct 15, 2024
1 parent 4aba33b commit 80736d2
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -35,5 +31,6 @@ public interface GtfsAreaSchema extends GtfsEntity {
@PrimaryKey
String areaId();

@NoInvalidCharacters
String areaName();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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();
}
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -13,6 +9,7 @@ public interface GtfsFareMediaSchema extends GtfsEntity {
@Required
String fareMediaId();

@NoInvalidCharacters
String fareMediaName();

@Required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -38,6 +31,7 @@ public interface GtfsFareProductSchema extends GtfsEntity {
@Index
String fareProductId();

@NoInvalidCharacters
String fareProductName();

@Required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
@ConditionallyRequired
public interface GtfsFeedInfoSchema extends GtfsEntity {
@Required
@NoInvalidCharacters
String feedPublisherName();

@Required
@FieldType(FieldTypeEnum.URL)
@NoInvalidCharacters
String feedPublisherUrl();

@Required
Expand All @@ -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();
}
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -15,5 +10,6 @@ public interface GtfsLocationGroupsSchema extends GtfsEntity {
String locationGroupId();

@MixedCase
@NoInvalidCharacters
String locationGroupName();
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ public interface GtfsNetworkSchema extends GtfsEntity {
String networkId();

@MixedCase
@NoInvalidCharacters
String networkName();
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ public interface GtfsPathwaySchema extends GtfsEntity {
double minWidth();

@MixedCase
@NoInvalidCharacters
String signpostedAs();

@MixedCase
@NoInvalidCharacters
String reversedSignpostedAs();
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ public interface GtfsRouteSchema extends GtfsEntity {
String routeLongName();

@MixedCase
@NoInvalidCharacters
String routeDesc();

@Required
@Index
GtfsRouteType routeType();

@FieldType(FieldTypeEnum.URL)
@NoInvalidCharacters
String routeUrl();

@DefaultValue("FFFFFF")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ public interface GtfsStopSchema extends GtfsEntity {
@Required
String stopId();

@NoInvalidCharacters
String stopCode();

@MixedCase
@ConditionallyRequired
@NoInvalidCharacters
String stopName();

@NoInvalidCharacters
String ttsStopName();

@NoInvalidCharacters
String stopDesc();

@FieldType(FieldTypeEnum.LATITUDE)
Expand All @@ -52,6 +55,7 @@ public interface GtfsStopSchema extends GtfsEntity {
String zoneId();

@FieldType(FieldTypeEnum.URL)
@NoInvalidCharacters
String stopUrl();

GtfsLocationType locationType();
Expand All @@ -60,6 +64,7 @@ public interface GtfsStopSchema extends GtfsEntity {
@Index
@ConditionallyRequired
@ForeignKey(table = "stops.txt", field = "stop_id")
@NoInvalidCharacters
String parentStation();

@FieldType(FieldTypeEnum.TIMEZONE)
Expand All @@ -71,5 +76,6 @@ public interface GtfsStopSchema extends GtfsEntity {
@ForeignKey(table = "levels.txt", field = "level_id")
String levelId();

@NoInvalidCharacters
String platformCode();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -70,6 +59,7 @@ public interface GtfsStopTimeSchema extends GtfsEntity {
int stopSequence();

@CachedField
@NoInvalidCharacters
String stopHeadsign();

GtfsTime startPickupDropOffWindow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@
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)
@Required
Locale language();

@Required
@NoInvalidCharacters
String translation();

@PrimaryKey(translationRecordIdType = UNSUPPORTED)
Expand All @@ -57,5 +57,6 @@ public interface GtfsTranslationSchema extends GtfsEntity {
@PrimaryKey(translationRecordIdType = UNSUPPORTED)
@ConditionallyRequired
@CachedField
@NoInvalidCharacters
String fieldValue();
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ public interface GtfsTripSchema extends GtfsEntity {
String serviceId();

@MixedCase
@NoInvalidCharacters
String tripHeadsign();

@MixedCase
@NoInvalidCharacters
String tripShortName();

GtfsTripDirectionId directionId();
Expand Down

0 comments on commit 80736d2

Please sign in to comment.