Class TypeUtility

java.lang.Object
org.gcube.informationsystem.utils.TypeUtility

public class TypeUtility extends Object
A utility class for retrieving the type name from various sources.
Author:
Luca Frosini (ISTI - CNR)
  • Constructor Details

    • TypeUtility

      public TypeUtility()
  • Method Details

    • getTypeName

      public static String getTypeName(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
      Gets the type name from a JsonNode.
      Parameters:
      jsonNode - The JSON node.
      Returns:
      The type name, or null if not found.
    • getTypeName

      public static String getTypeName(String json) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException, IOException
      Gets the type name from a JSON string.
      Parameters:
      json - The JSON string.
      Returns:
      The type name.
      Throws:
      IOException - if an I/O error occurs.
      org.gcube.com.fasterxml.jackson.core.JsonProcessingException - if a JSON processing error occurs.
    • getTypeName

      public static <E extends Element> String getTypeName(Class<E> clz)
      Gets the type name from a class that extends Element.
      Type Parameters:
      E - the element type
      Parameters:
      clz - The class.
      Returns:
      The type name.