public class JSONFormatter extends Object
PdxInstance
and methods to convert back PdxInstance
into JSON Document.
Using this, application can put json document in gemfire cache. Application can define indexes
on PdxInsatnce and then query those using OQL. Query will return the PdxInstances as results,
that needs to convert back into JSON document.
This uses Jackson parser to parse the json document. Parser treats values in json document as
number(byte, short, int, long..), string, array, object, 'true', 'false' or 'null'. Which
further treated as corresponding java types in PdxInstance
JSON objects are converted into PdxInstance
JSON arrays are converted into List.Modifier and Type | Field and Description |
---|---|
static String |
JSON_CLASSNAME |
Modifier and Type | Method and Description |
---|---|
static PdxInstance |
fromJSON(byte[] jsonByteArray)
To create PdxInstance from JSON string
|
static PdxInstance |
fromJSON(String jsonString)
To create PdxInstance from JSON string
|
static String |
toJSON(PdxInstance pdxInstance)
To create JSON string from PdxInstance
|
static byte[] |
toJSONByteArray(PdxInstance pdxInstance)
To create JSON byte array from PdxInstance
|
public static final String JSON_CLASSNAME
public static PdxInstance fromJSON(String jsonString)
JSONFormatterException
- if unable to parse JSON doucmentpublic static PdxInstance fromJSON(byte[] jsonByteArray)
JSONFormatterException
- if unable to parse JSON doucmentpublic static String toJSON(PdxInstance pdxInstance)
JSONFormatterException
- if unable to create JSON doucment from PdxInstancepublic static byte[] toJSONByteArray(PdxInstance pdxInstance)
JSONFormatterException
- if unable to create JSON doucment from PdxInstanceCopyright © 1997-2017 Pivotal Software, Inc. All rights reserved.