Package org.apereo.cas.util
Class JsonUtils
- java.lang.Object
-
- org.apereo.cas.util.JsonUtils
-
public class JsonUtils extends java.lang.ObjectJSON utility methods.- Since:
- 4.1
-
-
Constructor Summary
Constructors Constructor Description JsonUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisValidJson(java.lang.String json)Is valid json?.voidrender(java.lang.Object model, javax.servlet.http.HttpServletResponse response)Render model and view.voidrender(javax.servlet.http.HttpServletResponse response)Render model and view.voidrenderException(java.lang.Exception ex, javax.servlet.http.HttpServletResponse response)Render exceptions.
-
-
-
Method Detail
-
render
public void render(java.lang.Object model, javax.servlet.http.HttpServletResponse response)Render model and view.- Parameters:
model- the modelresponse- the response
-
render
public void render(javax.servlet.http.HttpServletResponse response)
Render model and view. Sets the response status to OK.- Parameters:
response- the response
-
renderException
public void renderException(java.lang.Exception ex, javax.servlet.http.HttpServletResponse response)Render exceptions. Adds error messages and the stack trace to the json model and sets the response status accordingly to note bad requests.- Parameters:
ex- the exresponse- the response
-
isValidJson
public boolean isValidJson(java.lang.String json)
Is valid json?.- Parameters:
json- the json- Returns:
- the boolean
-
-