Skip to content

Commit

Permalink
Update README with new object mapper settings. #21.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersDJohnson committed Feb 6, 2016
1 parent 2e3f32b commit ea923fe
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,22 @@ JsonNode node = (new JsonReferenceProcessor()).process(url);

### Settings
```java
ObjectMapper mapper = new ObjectMapper();
JsonReference processor = new JsonReferenceProcessor();

JsonReference processor = new JsonReferenceProcessor(mapper);
processor.setStopOnCircular(false); // default true

processor.setMaxDepth(2); // default 1

// Custom object mapper allowing comments.
processor.setMapperFactory(new ObjectMapperFactory() {
@Override
public ObjectMapper create(URL url) {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
return objectMapper;
}
});

JsonNode node = processor.process( /*...*/ );
```

Expand Down

0 comments on commit ea923fe

Please sign in to comment.