Class MapperService


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T parse​(java.lang.String strJson, java.lang.Class<T> t)
      parse the JSON for a bean
      static <T> T parse​(java.lang.String strJson, T bean)
      parse the JSON for an existing 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
      • parse

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