Class JsonObjectProducer
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.controller.json.JsonProducer
-
- edu.cornell.mannlib.vitro.webapp.controller.json.JsonObjectProducer
-
- Direct Known Subclasses:
GetAllVClasses,GetSearchIndividualsByVClass,GetSearchIndividualsByVClasses,GetVClassesForVClassGroup
public abstract class JsonObjectProducer extends JsonProducer
A base for classes that produce a JSON object, based on the parameters in the request. The result is never empty. At worst, it is an object that contains only an "errorMessage" field. If an exception occurrs during processing, The "errorMessage" field will contain the exception message and the response status will be set to 500 (server error). Normally, "errorMessage" will be empty, and the status will default to 200 (OK).
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.servlet.ServletContextctxprotected VitroRequestvreq
-
Constructor Summary
Constructors Modifier Constructor Description protectedJsonObjectProducer(VitroRequest vreq)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract com.fasterxml.jackson.databind.node.ObjectNodeprocess()Sub-classes implement this method.voidprocess(javax.servlet.http.HttpServletResponse resp)-
Methods inherited from class edu.cornell.mannlib.vitro.webapp.controller.json.JsonProducer
getVclassIds, getVclassParameter, individualsToJson
-
-
-
-
Field Detail
-
vreq
protected final VitroRequest vreq
-
ctx
protected final javax.servlet.ServletContext ctx
-
-
Constructor Detail
-
JsonObjectProducer
protected JsonObjectProducer(VitroRequest vreq)
-
-
Method Detail
-
process
protected abstract com.fasterxml.jackson.databind.node.ObjectNode process() throws ExceptionSub-classes implement this method. Given the request, produce a JSON object as the result.- Throws:
Exception
-
process
public final void process(javax.servlet.http.HttpServletResponse resp) throws IOException- Throws:
IOException
-
-