Class TypeUtility


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

      • TypeUtility

        public TypeUtility()
    • Method Detail

      • 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 ElementString 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.