1616
1717
1818import com .jayway .jsonpath .internal .EvaluationContext ;
19- import com .jayway .jsonpath .internal .JsonContext ;
19+ import com .jayway .jsonpath .internal .ParseContextImpl ;
2020import com .jayway .jsonpath .internal .Path ;
2121import com .jayway .jsonpath .internal .PathRef ;
2222import com .jayway .jsonpath .internal .Utils ;
@@ -499,7 +499,7 @@ public static <T> T read(Object json, String jsonPath, Predicate... filters) {
499499 */
500500 @ SuppressWarnings ({"unchecked" })
501501 public static <T > T read (String json , String jsonPath , Predicate ... filters ) {
502- return new JsonContext ().parse (json ).read (jsonPath , filters );
502+ return new ParseContextImpl ().parse (json ).read (jsonPath , filters );
503503 }
504504
505505
@@ -515,7 +515,7 @@ public static <T> T read(String json, String jsonPath, Predicate... filters) {
515515 @ SuppressWarnings ({"unchecked" })
516516 @ Deprecated
517517 public static <T > T read (URL jsonURL , String jsonPath , Predicate ... filters ) throws IOException {
518- return new JsonContext ().parse (jsonURL ).read (jsonPath , filters );
518+ return new ParseContextImpl ().parse (jsonURL ).read (jsonPath , filters );
519519 }
520520
521521 /**
@@ -529,7 +529,7 @@ public static <T> T read(URL jsonURL, String jsonPath, Predicate... filters) thr
529529 */
530530 @ SuppressWarnings ({"unchecked" })
531531 public static <T > T read (File jsonFile , String jsonPath , Predicate ... filters ) throws IOException {
532- return new JsonContext ().parse (jsonFile ).read (jsonPath , filters );
532+ return new ParseContextImpl ().parse (jsonFile ).read (jsonPath , filters );
533533 }
534534
535535 /**
@@ -543,7 +543,7 @@ public static <T> T read(File jsonFile, String jsonPath, Predicate... filters) t
543543 */
544544 @ SuppressWarnings ({"unchecked" })
545545 public static <T > T read (InputStream jsonInputStream , String jsonPath , Predicate ... filters ) throws IOException {
546- return new JsonContext ().parse (jsonInputStream ).read (jsonPath , filters );
546+ return new ParseContextImpl ().parse (jsonInputStream ).read (jsonPath , filters );
547547 }
548548
549549
@@ -555,13 +555,15 @@ public static <T> T read(InputStream jsonInputStream, String jsonPath, Predicate
555555
556556
557557 /**
558- * Creates a {@link ParseContext} that can be used to parse a given JSON input.
558+ * Creates a {@link ParseContext} that can be used to parse JSON input. The parse context
559+ * is as thread safe as the underlying {@link JsonProvider}. Note that not all JsonProvider are
560+ * thread safe.
559561 *
560562 * @param configuration configuration to use when parsing JSON
561563 * @return a parsing context based on given configuration
562564 */
563565 public static ParseContext using (Configuration configuration ) {
564- return new JsonContext (configuration );
566+ return new ParseContextImpl (configuration );
565567 }
566568
567569 /**
@@ -572,7 +574,7 @@ public static ParseContext using(Configuration configuration) {
572574 */
573575 @ Deprecated
574576 public static ParseContext using (JsonProvider provider ) {
575- return new JsonContext (Configuration .builder ().jsonProvider (provider ).build ());
577+ return new ParseContextImpl (Configuration .builder ().jsonProvider (provider ).build ());
576578 }
577579
578580 /**
@@ -583,7 +585,7 @@ public static ParseContext using(JsonProvider provider) {
583585 * @return a read context
584586 */
585587 public static DocumentContext parse (Object json ) {
586- return new JsonContext ().parse (json );
588+ return new ParseContextImpl ().parse (json );
587589 }
588590
589591 /**
@@ -594,7 +596,7 @@ public static DocumentContext parse(Object json) {
594596 * @return a read context
595597 */
596598 public static DocumentContext parse (String json ) {
597- return new JsonContext ().parse (json );
599+ return new ParseContextImpl ().parse (json );
598600 }
599601
600602 /**
@@ -605,7 +607,7 @@ public static DocumentContext parse(String json) {
605607 * @return a read context
606608 */
607609 public static DocumentContext parse (InputStream json ) {
608- return new JsonContext ().parse (json );
610+ return new ParseContextImpl ().parse (json );
609611 }
610612
611613 /**
@@ -616,7 +618,7 @@ public static DocumentContext parse(InputStream json) {
616618 * @return a read context
617619 */
618620 public static DocumentContext parse (File json ) throws IOException {
619- return new JsonContext ().parse (json );
621+ return new ParseContextImpl ().parse (json );
620622 }
621623
622624 /**
@@ -627,7 +629,7 @@ public static DocumentContext parse(File json) throws IOException {
627629 * @return a read context
628630 */
629631 public static DocumentContext parse (URL json ) throws IOException {
630- return new JsonContext ().parse (json );
632+ return new ParseContextImpl ().parse (json );
631633 }
632634
633635 /**
@@ -638,7 +640,7 @@ public static DocumentContext parse(URL json) throws IOException {
638640 * @return a read context
639641 */
640642 public static DocumentContext parse (Object json , Configuration configuration ) {
641- return new JsonContext (configuration ).parse (json );
643+ return new ParseContextImpl (configuration ).parse (json );
642644 }
643645
644646 /**
@@ -649,7 +651,7 @@ public static DocumentContext parse(Object json, Configuration configuration) {
649651 * @return a read context
650652 */
651653 public static DocumentContext parse (String json , Configuration configuration ) {
652- return new JsonContext (configuration ).parse (json );
654+ return new ParseContextImpl (configuration ).parse (json );
653655 }
654656
655657 /**
@@ -660,7 +662,7 @@ public static DocumentContext parse(String json, Configuration configuration) {
660662 * @return a read context
661663 */
662664 public static DocumentContext parse (InputStream json , Configuration configuration ) {
663- return new JsonContext (configuration ).parse (json );
665+ return new ParseContextImpl (configuration ).parse (json );
664666 }
665667
666668 /**
@@ -671,7 +673,7 @@ public static DocumentContext parse(InputStream json, Configuration configuratio
671673 * @return a read context
672674 */
673675 public static DocumentContext parse (File json , Configuration configuration ) throws IOException {
674- return new JsonContext (configuration ).parse (json );
676+ return new ParseContextImpl (configuration ).parse (json );
675677 }
676678
677679 /**
@@ -682,7 +684,7 @@ public static DocumentContext parse(File json, Configuration configuration) thro
682684 * @return a read context
683685 */
684686 public static DocumentContext parse (URL json , Configuration configuration ) throws IOException {
685- return new JsonContext (configuration ).parse (json );
687+ return new ParseContextImpl (configuration ).parse (json );
686688 }
687689
688690 private <T > T resultByConfiguration (Object jsonObject , Configuration configuration , EvaluationContext evaluationContext ) {
0 commit comments