private Condition parseJsonNode()

in jackson/src/main/java/com/spotify/hamcrest/jackson/IsJsonStringMatching.java [67:83]


  private Condition<JsonNode> parseJsonNode(
      final String string, final Description mismatchDescription) {
    if (string == null) {
      mismatchDescription.appendText(" but JSON string was null");
      return notMatched();
    }

    try {
      final JsonNode jsonNode = MAPPER.readTree(string);
      return matched(jsonNode, mismatchDescription);
    } catch (IOException e) {
      mismatchDescription
          .appendText(" but the string was not valid JSON ")
          .appendValue(e.getMessage());
      return notMatched();
    }
  }