Class JsonPipe

  • All Implemented Interfaces:
    Pipe

    public class JsonPipe
    extends AbstractInputStreamPipe
    Pipe outputting binding related to a json stream: either an object
    • Constructor Detail

      • JsonPipe

        public JsonPipe​(Plumber plumber,
                        org.apache.sling.api.resource.Resource resource,
                        PipeBindings upperBindings)
    • Method Detail

      • getOutput

        public Iterator<org.apache.sling.api.resource.Resource> getOutput​(InputStream is)
        in case there is no successful retrieval of some JSON data, we cut the pipe here
        Specified by:
        getOutput in class AbstractInputStreamPipe
        Returns:
        input resource of the pipe, can be reouputed N times in case output json binding is an array of N element (output binding would be here each time the Nth element of the array)
      • getValue

        protected javax.json.JsonStructure getValue​(javax.json.JsonStructure json,
                                                    String valuePath)
        Returns fetched json value from value path
        Parameters:
        json - json structure from which to start
        valuePath - path to follow
        Returns:
        value fetched after following the path