code: private void generateJSON(List<String> citationIds, ItemDataProvider provider,
  			PrintWriter out) {
  		StringJsonBuilderFactory factory = new StringJsonBuilderFactory();
  		//create an array of citation item data objects (either for
  		//the whole bibliography or for the given citation ids only)
  		out.print("[");
  		List<String> ids = citationIds;
  		if (ids.isEmpty()) {
  			ids = Arrays.asList(provider.getIds());
  		}
  		
  		int i = 0;
  		for (String id : ids) {
  			if (i > 0) {
  				out.print(",");
  			}
  			CSLItemData item = provider.retrieveItem(id);
  			JsonBuilder b = factory.createJsonBuilder();
  			out.print(item.toJson(b));
  			++i;
  		}
  		
  		out.println("]");
  	}
docs: Generates JSON
  @param citationIds the citation ids given on the command line
  @param provider a provider containing all citation item data
  @param out the print stream to write the output to