public class JsonPipe extends AbstractInputStreamPipe
Modifier and Type | Field and Description |
---|---|
protected static String |
ARRAY_START |
protected static String |
INDEX_SUFFIX |
static String |
JSON_KEY |
protected static Pattern |
JSONPATH_FIRSTTOKEN |
protected static String |
JSONPATH_ROOT |
protected static String |
OBJ_START |
protected static String |
PN_RAW
property specifying wether we should bind the computed json as a whole, or loop over it (not set or raw=false)
|
protected static String |
PN_VALUEPATH
property specifying the json path where to fetched the used value
|
static String |
RESOURCE_TYPE |
binding, BINDING_IS, REMOTE_START, VALID_PATH
afterHook, beforeHook, bindingProviders, bindings, distributionAgent, DRYRUN_EXPR, DRYRUN_KEY, EMPTY_ITERATOR, IGNORED_NODES, IGNORED_PROPERTIES, parent, plumber, PN_AFTERHOOK, PN_BEFOREHOOK, PN_STATUS, PN_STATUS_MODIFIED, properties, READ_ONLY, resolver, resource, RT_PREFIX, SLASH, STATUS_FINISHED, STATUS_STARTED
Constructor and Description |
---|
JsonPipe(Plumber plumber,
org.apache.sling.api.resource.Resource resource,
PipeBindings upperBindings) |
Modifier and Type | Method and Description |
---|---|
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
|
protected javax.json.JsonStructure |
getValue(javax.json.JsonStructure json,
String valuePath)
Returns fetched json value from value path
|
after, computeOutput, getOutputBinding
before, getBindings, getComputedPath, getConfiguration, getDistributionAgent, getExpr, getInput, getName, getOutput, getParent, getPath, getPreviousPipe, getPreviousResource, getRawExpression, getRawPath, getResource, isDryRun, isRootPath, modifiesContent, provideAdditionalBindings, setParent, toString
public static final String JSON_KEY
public static final String RESOURCE_TYPE
protected static final String PN_VALUEPATH
protected static final String PN_RAW
protected static final String JSONPATH_ROOT
protected static final String ARRAY_START
protected static final String OBJ_START
protected static final String INDEX_SUFFIX
protected static final Pattern JSONPATH_FIRSTTOKEN
public JsonPipe(Plumber plumber, org.apache.sling.api.resource.Resource resource, PipeBindings upperBindings)
public Iterator<org.apache.sling.api.resource.Resource> getOutput(InputStream is)
getOutput
in class AbstractInputStreamPipe
protected javax.json.JsonStructure getValue(javax.json.JsonStructure json, String valuePath)
json
- json structure from which to startvaluePath
- path to followCopyright © 2007–2022 The Apache Software Foundation. All rights reserved.