Class JsonStrings

java.lang.Object
io.jenkins.plugins.configsplice.engine.json.JsonStrings

public final class JsonStrings extends Object
Minimal JSON string literal codec.

Needed in both directions: encode(String) serialises a replacement, and decode(String) lets the locator prove that a candidate source range really is the token the structural parser reported, by decoding it and comparing against the parser's own value. That check is what turns a parser-reported offset from a hint into a verified fact.

  • Method Details

    • encode

      public static String encode(String value)
      Serialises value as a complete JSON string literal, including the surrounding quotes.
    • decode

      public static String decode(String body)
      Decodes the body of a JSON string literal, i.e. the text between the quotes.
      Returns:
      the decoded value, or null if the body is not well-formed