|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.schemarepo.json.GsonJsonUtil
public class GsonJsonUtil
An implementation of JsonUtil that uses google-gson.
| Constructor Summary | |
|---|---|
GsonJsonUtil()
|
|
| Method Summary | |
|---|---|
Iterable<SchemaEntry> |
schemasFromJson(String str)
Decode a string created by JsonUtil.schemasToJson(Iterable) |
String |
schemasToJson(Iterable<SchemaEntry> allEntries)
Encode SchemaEntry objects into a String for use by
JsonUtil.schemasFromJson(String)
The format is an array of objects containing id and schema fields, for example:
[{"id": "0", "schema": "schema1"}, {"id": "2", "schema": "schema2"}] |
Iterable<String> |
subjectNamesFromJson(String str)
Decode a string created by JsonUtil.subjectsToJson(Iterable) |
String |
subjectsToJson(Iterable<Subject> subjects)
Encode Subjects into a String for use by
JsonUtil.subjectNamesFromJson(String)
The format is an array of objects containing a name field, for example:
[{"name": "subject1"}, {"name": "subject2"}] |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GsonJsonUtil()
| Method Detail |
|---|
public String subjectsToJson(Iterable<Subject> subjects)
JsonUtilSubjects into a String for use by
JsonUtil.subjectNamesFromJson(String)
The format is an array of objects containing a name field, for example:
[{"name": "subject1"}, {"name": "subject2"}]
subjectsToJson in interface JsonUtilsubjects - the Subject objects to encode
Subject objects encoded as a Stringpublic Iterable<String> subjectNamesFromJson(String str)
JsonUtilJsonUtil.subjectsToJson(Iterable)
subjectNamesFromJson in interface JsonUtilstr - The String to decode
Iterable of Subjectpublic String schemasToJson(Iterable<SchemaEntry> allEntries)
JsonUtilSchemaEntry objects into a String for use by
JsonUtil.schemasFromJson(String)
The format is an array of objects containing id and schema fields, for example:
[{"id": "0", "schema": "schema1"}, {"id": "2", "schema": "schema2"}]
schemasToJson in interface JsonUtilallEntries - the SchemaEntry objects to encode
SchemaEntry objects encoded as a Stringpublic Iterable<SchemaEntry> schemasFromJson(String str)
JsonUtilJsonUtil.schemasToJson(Iterable)
schemasFromJson in interface JsonUtilstr - The String to decode
Iterable of SchemaEntry
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||