code: @Override
      public <E> E getJson(PortletPreferences prefs, String key, Class<E> type) throws IOException {
          final String prefValue = StringUtils.trimToNull(prefs.getValue(key, null));
          if (prefValue == null) {
              return null;
          }
          return mapper.readValue(prefValue, type);
      }
docs: Read the specified portlet preference and parse it as a JSON string into the specified type.
  If the preference is null returns null.
  
  @param prefs Preferences to read from
  @param key Preference key to read from
  @param type The class type parse the JSON into