JsonReferenceProcessor { public JsonNode read(URL url) throws IOException, JsonReferenceException { putIntoCache(url); return cache.get(url); }  boolean isCacheInMemory(); void setCacheInMemory(boolean cacheInMemory); int getMaxDepth(); void setMaxDepth(int maxDepth); boolean isStopOnCircular(); void setStopOnCircular(boolean stopOnCircular); boolean isPreserveRefs(); void setPreserveRefs(boolean preserveRefs); boolean isPreserveLocalRefs(); void setPreserveLocalRefs(boolean preserveLocalRefs); boolean isPreserveExternalRefs(); void setPreserveExternalRefs(boolean preserveExternalRefs); String getRefPrefix(); void setRefPrefix(String refPrefix); ObjectMapperFactory getMapperFactory(); void setMapperFactory(ObjectMapperFactory mapperFactory); JsonNode process(File file); JsonNode process(URL url); JsonNode process(JsonContext context, Set<JsonReference> processed); JsonNode process(JsonContext context); JsonNode process(JsonContext context, JsonNode node); JsonNode getReplacementNode(JsonNode node, JsonContext context); JsonReference getAbsoluteRef(JsonReference ref, JsonContext context); JsonContext resolveFromContextToContext(JsonReference ref, JsonContext context); JsonNode get(JsonReference ref); JsonNode read(URL url); JsonNode read(File file); JsonNode readFile(String fileString);  }
@Test public void testGetFromFile() throws IOException, JsonReferenceException { File file = resourceAsFile("a.json"); JsonNode jsonNode = (new JsonReferenceProcessor()).read(file).at("/a"); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(jsonNode); assertThat(json, equalTo("3")); }
@Test public void testGetFromJarFile() throws IOException, JsonReferenceException { URL jarFileURL = new URL("jar:file:" + resource("a.jar") + "!/a.json"); JsonNode jsonNode = (new JsonReferenceProcessor()).read(jarFileURL).at("/a"); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(jsonNode); assertThat(json, equalTo("3")); }