Class DeclaredPropertyResolver

java.lang.Object
org.gcube.informationsystem.resourceregistry.queries.json.base.DeclaredPropertyResolver

public class DeclaredPropertyResolver extends Object
Resolves the domain a Type definition declares for the property addressed by a query path.

The Type definitions are read through CachedType. A Type the model defines without a stored Type definition (Context, QueryTemplate, the Type-definition schemas and the embedded values they hold) is described by the definition its model class produces, the one its storage was created from. The properties a Type inherits are those its extended Types declare, up to the root of the hierarchy.

A path is followed through embedded Property values and through Lists and Sets of embedded values; a path through a List or Set denotes the collection of the values its last field takes across the elements. A path that leaves the declared properties, or reaches a Type that is not known, has no domain.

Author:
Luca Frosini (ISTI - CNR)
  • Field Details

    • PATH_SEPARATOR

      public static final String PATH_SEPARATOR
      The separator of the fields of a query path.
      See Also:
    • declaredTypes

      protected final Map<String,Map<String,org.gcube.informationsystem.types.PropertyTypeName>> declaredTypes
      The declared and inherited property types already read, by Type name and property name.
    • encryptedTypes

      protected final Map<String,Boolean> encryptedTypes
      Whether the Property types already met are Encrypted, by Type name.
  • Constructor Details

  • Method Details

    • resolve

      public PropertyDomain resolve(String typeName, String path) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Resolves the declared domain of a property path.
      Parameters:
      typeName - the Type the path starts from
      path - the dot-separated property path
      Returns:
      the declared domain, or null if the Type definitions do not declare the path
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if a Type definition cannot be read