Class JsonParser

java.lang.Object
io.github.joke.conventionalversion.config.JsonParser

public class JsonParser extends Object
Parses one of release-please's files into a JsonObject.

The parser is Groovy's, which every Gradle distribution ships in its own lib directory. Reading JSON therefore costs the consuming build nothing: the classes are already on the runtime executing the build, the plugin declares no dependency for them, and its published metadata still declares none. A bundled parser would have had to be relocated into the jar and excluded from mutation testing, and a hand-written one would have been the most expensive code here to cover.

  • Constructor Details

    • JsonParser

      public JsonParser()
  • Method Details

    • parse

      public JsonObject parse(String text, String source)
      source names the file, so a failure says which one could not be read.
    • slurp

      @VisibleForTesting protected Object slurp(String text, String source)
    • newSlurper

      @VisibleForTesting protected groovy.json.JsonSlurper newSlurper()
    • root

      @VisibleForTesting protected Map<String,Object> root(Object parsed, String source)