Class MapperJsonUtil


  • public final class MapperJsonUtil
    extends java.lang.Object
    JSON Mapper utils.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getJson​(java.lang.Object object)
      parse a bean into a json.
      static <T> T parse​(java.lang.String strJson, java.lang.Class<T> t)
      parse the JSON for a bean.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • parse

        public static <T> T parse​(java.lang.String strJson,
                                  java.lang.Class<T> t)
                           throws java.io.IOException
        parse the JSON for a bean.
        Type Parameters:
        T - The Bean class
        Parameters:
        strJson - The JSON
        t - The bean class
        Returns:
        The bean
        Throws:
        java.io.IOException - if an error occurs
      • getJson

        public static java.lang.String getJson​(java.lang.Object object)
                                        throws java.io.IOException
        parse a bean into a json.
        Parameters:
        object - the object
        Returns:
        The json
        Throws:
        java.io.IOException - if an error occurs