To use this method, {@link #objectMapper} should be a jsonMapper.
770172
protected FullResponseHolder submitJsonRequest(
      String taskId,
      HttpMethod method,
      String encodedPathSuffix,
      @Nullable String encodedQueryString,
      byte[] content,
      boolean retry
  ) throws IOException, ChannelException, NoTaskLocationException
  {
    return submitRequest(
        taskId,
        MediaType.APPLICATION_JSON,
        method,
        encodedPathSuffix,
        encodedQueryString,
        content,
        retry
    );
  }
970377
private JSONObject map2JSON(JSONObject jo, Map<String, Object> map) {
        for (Entry<String, Object> entry : map.entrySet()) {
            String subkeys = null;
            String key = null;
            Object value = entry.getValue();
            int i = entry.getKey().indexOf(".");
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "raw key, index", new Object[] { entry.getKey(), i });
            }
            if (i > -1) {
                subkeys = entry.getKey().substring(i + 1);
                key = entry.getKey().substring(0, i);
            } else {
                key = entry.getKey();
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "key, subkeys", new Object[] { key, subkeys });
            }
            if (subkeys == null) { // simple key
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "simple key: " + entry.getKey());
                }
                if (value == null) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "value is null");
                    }
                    jo.put(key, "null");
                } else if (value instanceof Map) { // value is a Map
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "value is a Map, calling map2JSON", value);
                    }
                    jo.put(key, map2JSON(new JSONObject(), (Map<String, Object>) value));
                } else if (value.getClass().isArray()) { // value is an array
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "value is an array, calling array2JSON", value);
                    }
                    jo.put(key, array2JSON(new JSONArray(), (Object[]) value));
                } else { // else value is a "simple" value
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "simple value, adding to jo", value);
                    }
                    jo.put(key, value);
                }
            } else { // compound key
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "compound key: " + entry.getKey());
                }
                JSONObject jsonSubstruc = (JSONObject) jo.get(key);
                if (jsonSubstruc == null) {
                    jsonSubstruc = new JSONObject();
                    jo.put(key, jsonSubstruc);
                }
                Map<String, Object> submap = new TreeMap<String, Object>();
                submap.put(subkeys, value);
                map2JSON(jsonSubstruc, submap);
            }
        }
        return jo;
    }
120266
private static Map<String, Object> readerToMap(JsonReader reader) throws IOException {
    Map<String, Object> map = new LinkedHashMap<String, Object>();
    reader.beginObject();
    while (reader.hasNext()) {
      map.put(reader.nextName(), readValue(reader));
    }
    reader.endObject();
    return map;
  }
1063067
public JsonWriter value(Map<String, ?> map) throws IOException {
      if (map == null) {
         nullValue();
      } else {
         boolean inObject = inObject();
         if (!inObject) beginObject();
         for (Map.Entry<String, ?> entry : map.entrySet()) {
            property(entry.getKey(), entry.getValue());
         }
         if (!inObject) endObject();
      }
      popIf(JsonTokenType.NAME);
      return this;
   }
522570
public static JSONObject mapToJsonObject(Map<String, Object> map)
    {
        JSONObject jsonObj = new JSONObject();
        
        try {
            for (String key : map.keySet())
            {
                Object value = map.get(key);
                if (value instanceof Map)
                    jsonObj.put(key, AjaxProxyTask.mapToJsonObject((Map)value));
                else
                    jsonObj.put(key, value);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
        
        return jsonObj;
    }
620841
protected Map jsonMap() {
        checkJsonContentType();
        try {
            return JsonHelper.toMap(getRequestString());
        } catch (IOException e) {
            throw new WebException(e);
        }
    }
719098
public static SoyMap legacyObjectMapToMap(SoyLegacyObjectMap map) {
    Map<SoyValue, SoyValueProvider> newMap = new HashMap<>();
    for (SoyValue key : map.getItemKeys()) {
      newMap.put(key, map.getItemProvider(key));
    }
    return SoyMapImpl.forProviderMap(newMap);
  }
708766
public Map<?, ?> formatJSON2Map(String json) {
		Map<?, ?> map = null;
		try {
			map = MAPPER.readValue(json, Map.class);
		} catch (Exception e) {
			LOGGER.error("formatJsonToMap error, json = " + json, e);
		}
		return map;
	}
857556
public static <T> T fromJson(JsonNode json, Class<T> clazz, ClassLoader classLoader) {
        if (json == null) {
            return null;
        }
        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
        if (classLoader != null) {
            Thread.currentThread().setContextClassLoader(classLoader);
        }
        try {
            ObjectMapper mapper = poolMapper.borrowObject();
            if (mapper != null) {
                try {
                    return mapper.readValue(json.toString(), clazz);
                } finally {
                    poolMapper.returnObject(mapper);
                }
            }
            throw new DeserializationException("No ObjectMapper instance avaialble!");
        } catch (Exception e) {
            throw e instanceof DeserializationException ? (DeserializationException) e
                    : new DeserializationException(e);
        } finally {
            Thread.currentThread().setContextClassLoader(oldClassLoader);
        }
    }
831209
private CodeBlock methodCallCodeWithJMapperTypeParameters( MapperInstance instance, ImmutableList<? extends JMapperType> parameters ) {
        CodeBlock.Builder builder = initMethodCallCode( instance );
        return methodCallCodeWithJMapperTypeParameters( builder, parameters );
    }
1077904
protected Map<String, Object> toObjectJSON() {
		final Map<String, Object> objectJSON = new LinkedHashMap<String, Object>();
		// TODO: select correct object type - usage of own types allowed?
		objectJSON.put("objectType", "article");
		objectJSON.put("type", this.type);
		objectJSON.put("id", this.id);

		return objectJSON;
	}
713356
private ObjectMapper createObjectMapperWithRootUnWrap() {
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
        mapper.addHandler(new CustomDeserializationProblemHandler());
       
        
        mapper.registerModule(new JodaModule());
        return mapper;
    }
954117
@Provides
    @Singleton
    JacksonJsonProvider getJacksonJsonProvider(final ObjectMapper objectMapper)
    {
        final JacksonJsonProvider provider = new JacksonJsonProvider();
        provider.setMapper(objectMapper);
        return provider;
    }
1041060
private ObjectMapper getObjectMapper() {
		ObjectMapper mapper = new ObjectMapper();
		AnnotationIntrospector primary = new JacksonAnnotationIntrospector();
		AnnotationIntrospector secondary = new JaxbAnnotationIntrospector();
		AnnotationIntrospector pair = new AnnotationIntrospectorPair(primary, secondary);

		mapper.setAnnotationIntrospector(pair);
		mapper.setSerializationInclusion(Include.NON_NULL);

		return mapper;
	}
1222177
public String toJson() throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        ByteArrayOutputStream out = new ByteArrayOutputStream();

        mapper.writeValue(out, this);
        return out.toString();
    }
734848
public static Map toMap(String json) {
        try {
            return mapper.readValue(json, Map.class);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
1087148
@Nullable
    static List<Object> jsonArrayToList(@Nullable JSONArray jsonArray) {
        if (jsonArray == null) {
            return null;
        }

        List<Object> objectList = new ArrayList<>();
        for (int i = 0; i < jsonArray.length(); i++) {
            try {
                Object ob = jsonArray.get(i);
                if (ob instanceof JSONArray) {
                    objectList.add(jsonArrayToList((JSONArray) ob));
                } else if (ob instanceof JSONObject) {
                    Map<String, Object> objectMap = jsonObjectToMap((JSONObject) ob);
                    if (objectMap != null) {
                        objectList.add(objectMap);
                    }
                } else {
                    if (NULL.equals(ob)) {
                        continue;
                    }
                    objectList.add(ob);
                }
            } catch (JSONException ignored) {
                // Nothing to do in this case.
            }
        }
        return objectList;
    }