|
GemFire 7.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.gemstone.gemfire.pdx.JSONFormatter
public class JSONFormatter
PdxFormatter class has static methods to convert JSON document into 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.
| Field Summary | |
|---|---|
static String |
JSON_CLASSNAME
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String JSON_CLASSNAME
| Method Detail |
|---|
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 PdxInstance
|
GemFire 7.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||