Class SerializerUtil


  • public class SerializerUtil
    extends Object
    The Class SerializerUtil.
    Author:
    Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it Sep 26, 2022
    • Constructor Detail

      • SerializerUtil

        public SerializerUtil()
    • Method Detail

      • readJSON

        public static <T> T readJSON​(String string,
                                     Class<T> clazz)
                              throws com.fasterxml.jackson.core.JsonProcessingException,
                                     IOException
        Read JSON.
        Type Parameters:
        T - the generic type
        Parameters:
        string - the string
        clazz - the clazz
        Returns:
        the t
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - the json processing exception
        IOException - Signals that an I/O exception has occurred.
      • unmarshalXML

        public static <T> T unmarshalXML​(String string,
                                         Class<T> theClass)
                                  throws Exception
        Unmarshal XML.
        Type Parameters:
        T - the generic type
        Parameters:
        string - the string
        theClass - the the class
        Returns:
        the class
        Throws:
        Exception - the exception