Package io.jans.as.server.ssa.ws.rs
Class SsaJsonService
- java.lang.Object
-
- io.jans.as.server.ssa.ws.rs.SsaJsonService
-
@Named public class SsaJsonService extends Object
Provides json utilities for SSA
-
-
Constructor Summary
Constructors Constructor Description SsaJsonService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.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.String
jsonArrayToString(org.json.JSONArray jsonArray)
Convert to json string from jsonArray.String
jsonObjectToString(org.json.JSONObject jsonObject)
Convert to json string from jsonObject.
-
-
-
Method Detail
-
jsonObjectToString
public String jsonObjectToString(org.json.JSONObject jsonObject) throws org.json.JSONException
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
public String jsonArrayToString(org.json.JSONArray jsonArray) throws org.json.JSONException
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
public org.json.JSONObject getJSONObject(String jwt) throws org.json.JSONException
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.
-
-