Class Viv.Json

java.lang.Object
com.benesult.vivjson.Viv.Json
Enclosing class:
Viv

public static class Viv.Json extends Object
JSON data class. In default, both of script's code and JSON value are accepted. This class is used if you want to accept as JSON value rather than script's code.

   String value = "{\"a\": 3}";
   String code = "return(a)";
   Viv.Result result = Viv.run(new Viv.Json(value), code);
   System.out.println(result.value);  // 3
 
  • Field Details

    • value

      public final String value
      JSON value.
  • Constructor Details

    • Json

      public Json(String value)
      Constructs JSON data class instance.
      Parameters:
      value - JSON value.