Package rife.json

Interface JsonArrayAction

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface JsonArrayAction
Captures an action that has to be executed on a JsonArray instance.

There's no need to implement this interface directly since it's intended to be provided as an inline lambda to JsonObject.array(String, JsonArrayAction) and JsonArray.array(JsonArrayAction). Those methods will construct a nested JSON array, call the action with it so that you can populate it, and attach it to the enclosing structure afterwards.

Since:
1.10
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes the action on the specified JsonArray instance.
  • Method Details

    • use

      void use(JsonArray a)
      Executes the action on the specified JsonArray instance.

      The JSON array has already been created, so you only have to populate it.

      Parameters:
      a - the JsonArray instance on which to execute the action
      Since:
      1.10