java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.PropertyElementManagement

public class PropertyElementManagement extends Object
Author:
Luca Frosini (ISTI - CNR)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Set<String>
    Keys that should be ignored during property mapping.
    static final Set<String>
    Prefixes of keys that should be ignored during property mapping.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.gcube.com.fasterxml.jackson.databind.JsonNode
    dropInvalidFields(String path, org.gcube.com.fasterxml.jackson.databind.JsonNode value, Set<String> droppedFields)
    Returns a copy of a submitted property value in which every nested Property value (a JSON object carrying type), at any depth, has lost the fields whose name breaks the property naming rule.
    static org.gcube.com.fasterxml.jackson.databind.JsonNode
    getJsonNode(com.orientechnologies.orient.core.record.impl.ODocument oDocument)
    Converts an ODocument to a JsonNode representing properties.
    static com.orientechnologies.orient.core.record.impl.ODocument
    getPropertyDocument(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNodeOrig)
    Converts a JsonNode representing properties to an ODocument.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PROPERTY_IGNORE_KEYS

      public static final Set<String> PROPERTY_IGNORE_KEYS
      Keys that should be ignored during property mapping.
    • PROPERTY_IGNORE_START_WITH_KEYS

      public static final Set<String> PROPERTY_IGNORE_START_WITH_KEYS
      Prefixes of keys that should be ignored during property mapping.
  • Constructor Details

    • PropertyElementManagement

      public PropertyElementManagement()
  • Method Details

    • getPropertyDocument

      public static com.orientechnologies.orient.core.record.impl.ODocument getPropertyDocument(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNodeOrig) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Converts a JsonNode representing properties to an ODocument.
      Parameters:
      jsonNodeOrig - the original JSON node to convert
      Returns:
      the converted ODocument
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if the conversion fails
    • dropInvalidFields

      public static org.gcube.com.fasterxml.jackson.databind.JsonNode dropInvalidFields(String path, org.gcube.com.fasterxml.jackson.databind.JsonNode value, Set<String> droppedFields)
      Returns a copy of a submitted property value in which every nested Property value (a JSON object carrying type), at any depth, has lost the fields whose name breaks the property naming rule. The keys of an untyped JSON object are data and are never dropped.
      Parameters:
      path - the name of the instance field holding the value
      value - the submitted value of the field
      droppedFields - collects the dropped fields in dot notation (e.g. myProperty.subField)
      Returns:
      the cleaned copy of value
    • getJsonNode

      public static org.gcube.com.fasterxml.jackson.databind.JsonNode getJsonNode(com.orientechnologies.orient.core.record.impl.ODocument oDocument) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Converts an ODocument to a JsonNode representing properties.
      Parameters:
      oDocument - the document to convert
      Returns:
      the converted JsonNode
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if the conversion fails