Class JsonProducer
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.controller.json.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 Summary
Constructors Constructor Description JsonProducer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>getVclassIds(VitroRequest vreq)Get one or more "vclassId" parameters from the request.protected VClassgetVclassParameter(VitroRequest vreq)Get the "vclassId" parameter from the request and instantiate the VClass.protected com.fasterxml.jackson.databind.node.ArrayNodeindividualsToJson(List<Individual> individuals)Process a list of Individuals into a JSON array that holds the Names and URIs.
-
-
-
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.
-
-