Skip to content

Commit

Permalink
Fixed backwards compatibility issue with renamed property types
Browse files Browse the repository at this point in the history
  • Loading branch information
hylkevds committed Apr 4, 2024
1 parent a39d3fe commit 00c02c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public class TypeComplex extends PropertyType {
public static final String STA_MAP_NAME = "Object";
public static final String STA_OBJECT_NAME = "ANY";
public static final String STA_TIMEINTERVAL_NAME = "TM_Period";
public static final String STA_TIMEINTERVAL_ALIAS = "TimeInterval";
public static final String STA_TIMEVALUE_NAME = "TM_Object";
public static final String STA_TIMEVALUE_ALIAS = "TimeValue";
public static final String NAME_INTERVAL_START = "start";
public static final String NAME_INTERVAL_END = "end";

Expand Down Expand Up @@ -95,6 +97,9 @@ public class TypeComplex extends PropertyType {
// It's not a TypeSimplePrimitive
}
}
TYPES.put(STA_TIMEINTERVAL_ALIAS, TYPES.get(STA_TIMEINTERVAL_NAME));
TYPES.put(STA_TIMEVALUE_ALIAS, TYPES.get(STA_TIMEVALUE_NAME));

}

public static TypeComplex getType(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class TypeSimpleCustom extends TypeSimple {

public static final String STA_GEOJSON_NAME = "Geometry";
public static final String STA_TM_INSTANT_NAME = "TM_Instant";
public static final String STA_TM_INSTANT_ALIAS = "TimeInstant";
public static final PropertyType STA_LOCATION = new TypeSimpleCustom(STA_GEOJSON_NAME, "A Free Location object", EDM_GEOMETRY)
.setDeserializer(ParserUtils.getLocationDeserializer());
public static final PropertyType STA_TM_INSTANT = new TypeSimpleCustom(STA_TM_INSTANT_NAME, "A Time Instant", EDM_DATETIMEOFFSET);
Expand All @@ -62,6 +63,7 @@ public class TypeSimpleCustom extends TypeSimple {
// It's not a TypeSimplePrimitive
}
}
TYPES.put(STA_TM_INSTANT_ALIAS, TYPES.get(STA_TM_INSTANT_NAME));
}

public static TypeSimpleCustom getType(String name) {
Expand Down

0 comments on commit 00c02c0

Please sign in to comment.