Class PropertyElementManagement
java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.PropertyElementManagement
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionKeys that should be ignored during property mapping.Prefixes of keys that should be ignored during property mapping. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.gcube.com.fasterxml.jackson.databind.JsonNodedropInvalidFields(String path, org.gcube.com.fasterxml.jackson.databind.JsonNode value, Set<String> droppedFields) Returns a copy of a submitted property value in which every nestedPropertyvalue (a JSON object carryingtype), at any depth, has lost the fields whose name breaks the property naming rule.static org.gcube.com.fasterxml.jackson.databind.JsonNodegetJsonNode(com.orientechnologies.orient.core.record.impl.ODocument oDocument) Converts anODocumentto aJsonNoderepresenting properties.static com.orientechnologies.orient.core.record.impl.ODocumentgetPropertyDocument(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNodeOrig) Converts aJsonNoderepresenting properties to anODocument.
-
Field Details
-
PROPERTY_IGNORE_KEYS
Keys that should be ignored during property mapping. -
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 aJsonNoderepresenting properties to anODocument.- 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 nestedPropertyvalue (a JSON object carryingtype), 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 valuevalue- the submitted value of the fielddroppedFields- 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 anODocumentto aJsonNoderepresenting properties.- Parameters:
oDocument- the document to convert- Returns:
- the converted
JsonNode - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the conversion fails
-