Class JsonProducer

  • Direct Known Subclasses:
    JsonArrayProducer, JsonObjectProducer

    public abstract class JsonProducer
    extends Object
    A base for the classes that produce JSON results. Contains some useful constants and convenience methods.
    • Constructor Detail

      • JsonProducer

        public JsonProducer()
    • Method Detail

      • individualsToJson

        protected com.fasterxml.jackson.databind.node.ArrayNode individualsToJson​(List<Individual> individuals)
                                                                           throws javax.servlet.ServletException
        Process a list of Individuals into a JSON array that holds the Names and URIs.
        Throws:
        javax.servlet.ServletException
      • getVclassParameter

        protected VClass getVclassParameter​(VitroRequest vreq)
        Get the "vclassId" parameter from the request and instantiate the VClass. There must be one, and it must be valid.
      • getVclassIds

        protected List<String> getVclassIds​(VitroRequest vreq)
        Get one or more "vclassId" parameters from the request. Confirm that there is at least one, and that all are valid. Return value is never null and never empty.