forked from json-snapshot/json-snapshot.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix json-snapshot#27: Lib can not be used with Jackson 2.10.0 or later
- Loading branch information
Showing
3 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/io/github/jsonSnapshot/CustomDefaultPrettyPrinter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.github.jsonSnapshot; | ||
|
||
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter; | ||
import com.fasterxml.jackson.core.util.Separators; | ||
|
||
public class CustomDefaultPrettyPrinter extends DefaultPrettyPrinter { | ||
public CustomDefaultPrettyPrinter(String s) { | ||
super(s); | ||
} | ||
|
||
@Override | ||
public DefaultPrettyPrinter withSeparators(Separators separators) { | ||
this._separators = separators; | ||
this._objectFieldValueSeparatorWithSpaces = separators.getObjectFieldValueSeparator() + " "; | ||
return this; | ||
} | ||
|
||
@Override | ||
public DefaultPrettyPrinter createInstance() { | ||
return new DefaultPrettyPrinter(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters