Package com.day.cq.commons
Class TidyJsonItemWriter
- java.lang.Object
-
- org.apache.sling.commons.json.jcr.JsonItemWriter
-
- com.day.cq.commons.TidyJsonItemWriter
-
- Direct Known Subclasses:
SitecatalystJsonItemWriter
public class TidyJsonItemWriter extends JsonItemWriter
Extension of the JsonItemWriter that uses aTidyJSONWriter
.
-
-
Field Summary
-
Fields inherited from class org.apache.sling.commons.json.jcr.JsonItemWriter
DATE_FORMAT_LOCALE, ECMA_DATE_FORMAT
-
-
Constructor Summary
Constructors Constructor Description TidyJsonItemWriter(java.util.Set<java.lang.String> propertyNamesToIgnore)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dump(NodeIterator it, java.io.Writer out)
Dump all Nodes of given NodeIterator in JSONvoid
dump(NodeIterator it, JSONWriter w)
Dump all Nodes of given NodeIterator in JSONvoid
dump(Node node, java.io.Writer w, int maxRecursionLevels)
Dump given node in JSON, optionally recursing into its child nodesvoid
dump(Node node, JSONWriter w, int maxRecursionLevels)
Dump given node in JSON, optionally recursing into its child nodesvoid
dump(Property p, java.io.Writer w)
Dump given property in JSONvoid
dump(Property p, JSONWriter w)
Dump the property in JSONboolean
isTidy()
Checks if the output is nicely formatted.void
setTidy(boolean tidy)
Controls if output should be nicely formatted.-
Methods inherited from class org.apache.sling.commons.json.jcr.JsonItemWriter
dump, format
-
-
-
-
Constructor Detail
-
TidyJsonItemWriter
public TidyJsonItemWriter(java.util.Set<java.lang.String> propertyNamesToIgnore)
Constructor- Parameters:
propertyNamesToIgnore
- See javadoc of constructor ofJsonItemWriter
-
-
Method Detail
-
isTidy
public boolean isTidy()
Checks if the output is nicely formatted.- Returns:
true
if nicely formatted
-
setTidy
public void setTidy(boolean tidy)
Controls if output should be nicely formatted.- Parameters:
tidy
-true
to nicely format.
-
dump
public void dump(Node node, JSONWriter w, int maxRecursionLevels) throws RepositoryException, JSONException
Dump given node in JSON, optionally recursing into its child nodes- Parameters:
node
- node to dumpw
-JSONWriter
maxRecursionLevels
- max recursion level- Throws:
RepositoryException
- if some error occursJSONException
- if some error occurs
-
dump
public void dump(Node node, java.io.Writer w, int maxRecursionLevels) throws RepositoryException, JSONException
Dump given node in JSON, optionally recursing into its child nodes- Overrides:
dump
in classJsonItemWriter
- Throws:
RepositoryException
JSONException
-
dump
public void dump(NodeIterator it, JSONWriter w) throws RepositoryException, JSONException
Dump all Nodes of given NodeIterator in JSON- Parameters:
it
-NodeIterator
w
-JSONWriter
- Throws:
RepositoryException
- if some error occursJSONException
- if some error occurs
-
dump
public void dump(NodeIterator it, java.io.Writer out) throws RepositoryException, JSONException
Dump all Nodes of given NodeIterator in JSON- Overrides:
dump
in classJsonItemWriter
- Throws:
JSONException
RepositoryException
-
dump
public void dump(Property p, JSONWriter w) throws JSONException, RepositoryException
Dump the property in JSON- Parameters:
p
- property to dumpw
-JSONWriter
- Throws:
RepositoryException
- if some error occursJSONException
- if some error occurs
-
dump
public void dump(Property p, java.io.Writer w) throws JSONException, ValueFormatException, RepositoryException
Dump given property in JSON- Overrides:
dump
in classJsonItemWriter
- Throws:
JSONException
ValueFormatException
RepositoryException
-
-