Package io.jans.as.server.ssa.ws.rs
Class SsaJsonService
java.lang.Object
io.jans.as.server.ssa.ws.rs.SsaJsonService
Provides json utilities for SSA
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.json.JSONArray
getJSONArray
(List<io.jans.as.common.model.ssa.Ssa> ssaList) Convert to JSONArray from ssaList with structure SSA.org.json.JSONObject
getJSONObject
(String jwt) Convert to JSON using jwt.jsonArrayToString
(org.json.JSONArray jsonArray) Convert to json string from jsonArray.jsonObjectToString
(org.json.JSONObject jsonObject) Convert to json string from jsonObject.
-
Constructor Details
-
SsaJsonService
public SsaJsonService()
-
-
Method Details
-
jsonObjectToString
Convert to json string from jsonObject.- Parameters:
jsonObject
- Json object to convert- Returns:
- Json string
- Throws:
org.json.JSONException
- If an error is found when converting.
-
jsonArrayToString
Convert to json string from jsonArray.- Parameters:
jsonArray
- Json array to convert- Returns:
- Json string
- Throws:
org.json.JSONException
- If an error is found when converting.
-
getJSONArray
public org.json.JSONArray getJSONArray(List<io.jans.as.common.model.ssa.Ssa> ssaList) throws org.json.JSONException Convert to JSONArray from ssaList with structure SSA.Method generates the SSA structure to add them to a json array.
- Parameters:
ssaList
- List of SSA- Returns:
- Json array
- Throws:
org.json.JSONException
- If an error is found when converting.
-
getJSONObject
Convert to JSON using jwt.- Parameters:
jwt
- json web token of SSA- Returns:
- Json object.
- Throws:
org.json.JSONException
- If an error is found when converting.
-