| Modifier and Type | Field and Description |
|---|---|
static String |
HARRAY
Selector that causes hierarchy to be rendered as arrays
instead of child objects - useful to preserve the order of those
child objects
|
static int |
INDENT_SPACES
How much to indent in tidy mode
|
static String |
INFINITY
Recursion level selector that means "all levels"
|
static String |
TIDY
Selector that means "pretty-print the output
|
| Constructor and Description |
|---|
JsonRenderer(long maximumResults,
boolean ecmaSupport) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
getMaxRecursionLevel(org.apache.sling.api.SlingHttpServletRequest req)
Get recursion level from selectors. as per SLING-167: the last selector, if present, gives the recursion level.
|
protected boolean |
hasSelector(org.apache.sling.api.SlingHttpServletRequest req,
String selectorToCheck)
Checks if the provided request contains a certain selector.
|
protected boolean |
isTidy(org.apache.sling.api.SlingHttpServletRequest req)
True if our request wants the "tidy" pretty-printed format
|
void |
render(org.apache.sling.api.SlingHttpServletRequest req,
org.apache.sling.api.SlingHttpServletResponse resp) |
public static final String INFINITY
public static final String TIDY
public static final String HARRAY
public static final int INDENT_SPACES
public void render(org.apache.sling.api.SlingHttpServletRequest req,
org.apache.sling.api.SlingHttpServletResponse resp)
throws IOException
render in interface RendererIOExceptionprotected int getMaxRecursionLevel(org.apache.sling.api.SlingHttpServletRequest req)
throws IllegalArgumentException
req - the requestIllegalArgumentException - if the detected selector is not a numberprotected boolean hasSelector(org.apache.sling.api.SlingHttpServletRequest req,
String selectorToCheck)
req - the requestselectorToCheck - the selectortrue if the selector is present, false otherwiseprotected boolean isTidy(org.apache.sling.api.SlingHttpServletRequest req)
req - the requesttrue if the request contains the TIDY selector, false otherwiseCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.