Class 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 Detail

      • 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 Exception
        Sub-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