public final class JsonUnflattener extends Object
JsonUnflattener provides a static unflatten(String) method
to unflatten any flattened JSON string back to nested one.| Constructor and Description |
|---|
JsonUnflattener(Reader jsonReader)
Creates a JSON unflattener.
|
JsonUnflattener(String json)
Creates a JSON unflattener.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
hashCode() |
String |
toString() |
String |
unflatten()
Returns a JSON string of nested objects by the given flattened JSON string.
|
static String |
unflatten(String json)
Returns a JSON string of nested objects by the given flattened JSON string.
|
JsonUnflattener |
withFlattenMode(FlattenMode flattenMode)
A fluent setter to setup a mode of the
JsonUnflattener. |
JsonUnflattener |
withKeyTransformer(KeyTransformer keyTrans)
A fluent setter to setup a
KeyTransformer of the
JsonUnflattener. |
JsonUnflattener |
withLeftAndRightBrackets(char leftBracket,
char rightBracket)
A fluent setter to setup the left and right brackets within a key in the
flattened JSON.
|
JsonUnflattener |
withPrintMode(PrintMode printMode)
A fluent setter to setup a print mode of the
JsonUnflattener. |
JsonUnflattener |
withSeparator(char separator)
A fluent setter to setup the separator within a key in the flattened JSON.
|
public JsonUnflattener(String json)
json - the JSON stringpublic JsonUnflattener(Reader jsonReader) throws IOException
jsonReader - the JSON readerIOException - if jsonReader cannot be readpublic static String unflatten(String json)
json - a flattened JSON stringpublic JsonUnflattener withFlattenMode(FlattenMode flattenMode)
JsonUnflattener.flattenMode - a FlattenModeJsonUnflattenerpublic JsonUnflattener withSeparator(char separator)
separator - any characterJsonUnflattenerpublic JsonUnflattener withLeftAndRightBrackets(char leftBracket, char rightBracket)
leftBracket - any characterrightBracket - any characterJsonUnflattenerpublic JsonUnflattener withPrintMode(PrintMode printMode)
JsonUnflattener. The
default print mode is minimal.printMode - a PrintModeJsonUnflattenerpublic JsonUnflattener withKeyTransformer(KeyTransformer keyTrans)
KeyTransformer of the
JsonUnflattener.keyTrans - a KeyTransformerJsonUnflattenerpublic String unflatten()
Copyright © 2017. All rights reserved.