com.technophobia.substeps.glossary.JsonSubstepsPublisher Maven / Gradle / Ivy
package com.technophobia.substeps.glossary;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.Collection;
import java.util.Map;
/**
* Contributed to substeps by Andrew Lee
*
* A publisher which produces a json representation of the glossary.
*
* The resultant json can be used by Api Viewer
*
* @author Andrew Lee
*/
public class JsonSubstepsPublisher extends FileBasedGlossaryPublisher implements GlossaryPublisher {
@Override
public String getDefaultFileName() {
return "stepimplementations.json";
}
@Override
public String buildFileContents(final Map> sectionSorted) {
Gson gson = new GsonBuilder().create();
return gson.toJson(sectionSorted);
}
}