Package edu.sc.seis.sod.web.jsonapi
Class JsonApi
java.lang.Object
edu.sc.seis.sod.web.jsonapi.JsonApi
public class JsonApi
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTRIBUTES
static java.lang.String
DATA
static java.lang.String
DETAIL
static java.lang.String
ERRORS
static java.lang.String
ID
static java.lang.String
INCLUDED
static java.lang.String
LINKS
static java.lang.String
META
static java.lang.String
RELATIONSHIPS
static java.lang.String
SELF
static java.lang.String
TYPE
-
Constructor Summary
Constructors Constructor Description JsonApi()
-
Method Summary
Modifier and Type Method Description static JsonApiObject
decode(org.json.JSONObject json)
static void
encodeError(org.json.JSONWriter out, java.lang.String message)
static void
encodeJson(org.json.JSONWriter out, JsonApiData data)
static void
encodeJson(org.json.JSONWriter out, java.util.List<JsonApiData> dataList)
static void
encodeJsonWithoutInclude(org.json.JSONWriter out, java.util.List<JsonApiData> dataList)
static boolean
hasData(org.json.JSONObject json)
static boolean
hasIncluded(org.json.JSONObject json)
static boolean
hasLinks(org.json.JSONObject json)
static boolean
hasRelationships(org.json.JSONObject json)
protected static void
internalEncodeJsonWithoutInclude(org.json.JSONWriter out, java.util.List<JsonApiData> dataList)
static org.json.JSONObject
loadFromReader(java.io.BufferedReader in)
-
Field Details
-
DETAIL
public static final java.lang.String DETAIL- See Also:
- Constant Field Values
-
ERRORS
public static final java.lang.String ERRORS- See Also:
- Constant Field Values
-
RELATIONSHIPS
public static final java.lang.String RELATIONSHIPS- See Also:
- Constant Field Values
-
LINKS
public static final java.lang.String LINKS- See Also:
- Constant Field Values
-
META
public static final java.lang.String META- See Also:
- Constant Field Values
-
ATTRIBUTES
public static final java.lang.String ATTRIBUTES- See Also:
- Constant Field Values
-
TYPE
public static final java.lang.String TYPE- See Also:
- Constant Field Values
-
ID
public static final java.lang.String ID- See Also:
- Constant Field Values
-
INCLUDED
public static final java.lang.String INCLUDED- See Also:
- Constant Field Values
-
DATA
public static final java.lang.String DATA- See Also:
- Constant Field Values
-
SELF
public static final java.lang.String SELF- See Also:
- Constant Field Values
-
-
Constructor Details
-
JsonApi
public JsonApi()
-
-
Method Details
-
encodeJson
public static void encodeJson(org.json.JSONWriter out, JsonApiData data) throws org.json.JSONException- Throws:
org.json.JSONException
-
encodeJsonWithoutInclude
public static void encodeJsonWithoutInclude(org.json.JSONWriter out, java.util.List<JsonApiData> dataList) throws org.json.JSONException- Throws:
org.json.JSONException
-
internalEncodeJsonWithoutInclude
protected static void internalEncodeJsonWithoutInclude(org.json.JSONWriter out, java.util.List<JsonApiData> dataList) throws org.json.JSONException- Throws:
org.json.JSONException
-
encodeJson
public static void encodeJson(org.json.JSONWriter out, java.util.List<JsonApiData> dataList) throws org.json.JSONException- Throws:
org.json.JSONException
-
encodeError
public static void encodeError(org.json.JSONWriter out, java.lang.String message) -
loadFromReader
public static org.json.JSONObject loadFromReader(java.io.BufferedReader in) throws java.io.IOException- Throws:
java.io.IOException
-
hasData
public static boolean hasData(org.json.JSONObject json) -
hasRelationships
public static boolean hasRelationships(org.json.JSONObject json) -
hasLinks
public static boolean hasLinks(org.json.JSONObject json) -
hasIncluded
public static boolean hasIncluded(org.json.JSONObject json) -
decode
- Throws:
JsonApiException
-