Class JsonResponse

  • All Implemented Interfaces:
    org.kohsuke.stapler.HttpResponse

    public class JsonResponse
    extends Object
    implements org.kohsuke.stapler.HttpResponse
    POJO converted to JSON via Jackson as HTTP response.
    Author:
    Kohsuke Kawaguchi
    • Field Detail

      • pojo

        public final Object pojo
      • mapper

        public final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • JsonResponse

        public JsonResponse​(com.fasterxml.jackson.databind.ObjectMapper mapper,
                            Object pojo)
    • Method Detail

      • generateResponse

        public void generateResponse​(org.kohsuke.stapler.StaplerRequest req,
                                     org.kohsuke.stapler.StaplerResponse rsp,
                                     Object node)
                              throws IOException,
                                     javax.servlet.ServletException
        Specified by:
        generateResponse in interface org.kohsuke.stapler.HttpResponse
        Throws:
        IOException
        javax.servlet.ServletException