Package groovy.json

Class JsonDelegate

  • All Implemented Interfaces:
    GroovyObject

    public class JsonDelegate
    extends GroovyObjectSupport
    Utility class used as delegate of closures representing JSON objects.
    Since:
    1.8.0
    • Constructor Detail

      • JsonDelegate

        public JsonDelegate()
    • Method Detail

      • cloneDelegateAndGetContent

        public static Map<String,​Object> cloneDelegateAndGetContent​(Closure<?> c)
        Factory method for creating JsonDelegates from closures.
        Parameters:
        c - closure representing JSON objects
        Returns:
        an instance of JsonDelegate
      • curryDelegateAndGetContent

        public static Map<String,​Object> curryDelegateAndGetContent​(Closure<?> c,
                                                                          Object o)
        Factory method for creating JsonDelegates from closures currying an object argument.
        Parameters:
        c - closure representing JSON objects
        o - an object curried to the closure
        Returns:
        an instance of JsonDelegate