Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-308

QueryServlet.setSerializerClass is not very extensible

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3
    • 1.4
    • web
    • None

    Description

      Since QueryServlet instantiates the serializer automatically based on the serializer class, it precludes callers from using serializers that maintain state of any kind. Specifically, QueryServlet cannot be used with CSVSerializer, since CSVSerializer requires the setup of keys.

      We should simply provide an abstract newSerializer() method that subclasses implement to return an appropriate serializer. A private concrete method of the same name already exists and uses Class.newInstance() to return the serializer.

      NOTE: This change will constitute an API change for subclasses of QueryServlet – instead of using serializerClass, they'll have to implement newSerializer().

      Attachments

        Activity

          People

            tvolkert Todd Volkert
            tvolkert Todd Volkert
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: