java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.postgres.repositoryconnector.mappers.NestedPropertyName

public final class NestedPropertyName extends Object
Encodes the names of nested properties - the keys of a map, the attributes of a struct and the indexes of an array - in the property name column of the attribute value tables.

A nested property is stored with a property name made of its parent's property name, a colon, and its own name, such as additionalProperties:jobType. A map key may itself contain a colon (for example tag:coco), so each name added to the path is escaped: a backslash becomes \\ and a colon becomes \:. The path is then split only on unescaped colons, and a name is unescaped only when it becomes a property name again.

  • Method Details

    • escape

      public static String escape(String name)
      Escape a name so that it can be added to a property name path.
      Parameters:
      name - name of a nested property (map key, struct attribute or array index)
      Returns:
      escaped name
    • unescape

      public static String unescape(String escapedName)
      Parameters:
      escapedName - escaped name
      Returns:
      original name
    • split

      public static List<String> split(String propertyName)
      Split a property name path on its unescaped colons. The parts keep their escaping.
      Parameters:
      propertyName - property name path, such as additionalProperties:tag\:coco
      Returns:
      parts of the path, such as additionalProperties and tag\:coco