Added support for generic Json Object and array

This commit is contained in:
Luca Frosini 2025-01-14 18:53:12 +01:00
parent d4dc4a3f40
commit fcf5eda16a
1 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,8 @@ import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import org.gcube.com.fasterxml.jackson.databind.node.ArrayNode;
import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode;
import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.base.reference.properties.PropertyElement;
import org.gcube.informationsystem.utils.Version;
@ -75,6 +77,10 @@ public class PropertyTypeName {
BYTE("Byte"),
JSON_OBJECT("JsonObject"),
JSON_ARRAY("JsonArray"),
/*
* All base types which DON'T have a generic must be defined BEFORE BaseType.PROPERTY
*/
@ -160,6 +166,9 @@ public class PropertyTypeName {
BASE_PROPERTY_TYPES_BY_CLASS.put(byte[].class, BaseType.BINARY);
BASE_PROPERTY_TYPES_BY_CLASS.put(Byte[].class, BaseType.BINARY);
BASE_PROPERTY_TYPES_BY_CLASS.put(ObjectNode.class, BaseType.JSON_OBJECT);
BASE_PROPERTY_TYPES_BY_CLASS.put(ArrayNode.class, BaseType.JSON_ARRAY);
BASE_PROPERTY_TYPES_BY_CLASS.put(PropertyElement.class, BaseType.PROPERTY);
BASE_PROPERTY_TYPES_BY_CLASS.put(List.class, BaseType.LIST);