Class IsJson<T>

java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<T>
com.jayway.jsonpath.matchers.IsJson<T>
All Implemented Interfaces:
org.hamcrest.Matcher<T>, org.hamcrest.SelfDescribing

public class IsJson<T> extends org.hamcrest.TypeSafeMatcher<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final org.hamcrest.Matcher<? super ReadContext>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    IsJson(org.hamcrest.Matcher<? super ReadContext> jsonMatcher)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
    buildMismatchDescription(Object json, org.hamcrest.Description mismatchDescription, Exception e)
     
    protected void
    describeMismatchSafely(T json, org.hamcrest.Description mismatchDescription)
     
    void
    describeTo(org.hamcrest.Description description)
     
    protected boolean
     
    private static ReadContext
    parse(Object object)
     

    Methods inherited from class org.hamcrest.TypeSafeMatcher

    describeMismatch, matches

    Methods inherited from class org.hamcrest.BaseMatcher

    _dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • jsonMatcher

      private final org.hamcrest.Matcher<? super ReadContext> jsonMatcher
  • Constructor Details

    • IsJson

      public IsJson(org.hamcrest.Matcher<? super ReadContext> jsonMatcher)
  • Method Details

    • matchesSafely

      protected boolean matchesSafely(T json)
      Specified by:
      matchesSafely in class org.hamcrest.TypeSafeMatcher<T>
    • describeTo

      public void describeTo(org.hamcrest.Description description)
    • describeMismatchSafely

      protected void describeMismatchSafely(T json, org.hamcrest.Description mismatchDescription)
      Overrides:
      describeMismatchSafely in class org.hamcrest.TypeSafeMatcher<T>
    • buildMismatchDescription

      private static void buildMismatchDescription(Object json, org.hamcrest.Description mismatchDescription, Exception e)
    • parse

      private static ReadContext parse(Object object) throws IOException
      Throws:
      IOException