Package org.opencms.xml.xml2json
Class CmsJsonResult
java.lang.Object
org.opencms.xml.xml2json.CmsJsonResult
Result of rendering JSON.
Can be either a JSON value together with a response status, or a resource that should be loaded for the current request.
-
Constructor Summary
ConstructorDescriptionCmsJsonResult
(Object json, int status) Creates a new instance.CmsJsonResult
(CmsResource resource) Creates a result which indicates that a different resource should be loaded instead. -
Method Summary
Modifier and TypeMethodDescriptiongetJson()
Gets the JSON data.Gets the next resource which should be loaded.int
Gets the HTTP status code to set.
-
Constructor Details
-
CmsJsonResult
Creates a result which indicates that a different resource should be loaded instead.- Parameters:
resource
- the resource
-
CmsJsonResult
Creates a new instance.- Parameters:
json
- the JSON datastatus
- the result
-
-
Method Details
-
getJson
Gets the JSON data.- Returns:
- the JSON data
-
getNextResource
Gets the next resource which should be loaded.- Returns:
- the resource which should be loaded
-
getStatus
Gets the HTTP status code to set.- Returns:
- the HTTP status
-