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 voiddump(javax.jcr.NodeIterator it, java.io.Writer out)Dump all Nodes of given NodeIterator in JSONvoiddump(javax.jcr.NodeIterator it, JSONWriter w)Dump all Nodes of given NodeIterator in JSONvoiddump(javax.jcr.Node node, java.io.Writer w, int maxRecursionLevels)Dump given node in JSON, optionally recursing into its child nodesvoiddump(javax.jcr.Node node, JSONWriter w, int maxRecursionLevels)Dump given node in JSON, optionally recursing into its child nodesvoiddump(javax.jcr.Property p, java.io.Writer w)Dump given property in JSONvoiddump(javax.jcr.Property p, JSONWriter w)Dump the property in JSONbooleanisTidy()Checks if the output is nicely formatted.voidsetTidy(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:
trueif nicely formatted
-
setTidy
public void setTidy(boolean tidy)
Controls if output should be nicely formatted.- Parameters:
tidy-trueto nicely format.
-
dump
public void dump(javax.jcr.Node node, JSONWriter w, int maxRecursionLevels) throws javax.jcr.RepositoryException, JSONExceptionDump given node in JSON, optionally recursing into its child nodes- Parameters:
node- node to dumpw-JSONWritermaxRecursionLevels- max recursion level- Throws:
javax.jcr.RepositoryException- if some error occursJSONException- if some error occurs
-
dump
public void dump(javax.jcr.Node node, java.io.Writer w, int maxRecursionLevels) throws javax.jcr.RepositoryException, JSONExceptionDump given node in JSON, optionally recursing into its child nodes- Overrides:
dumpin classJsonItemWriter- Throws:
javax.jcr.RepositoryExceptionJSONException
-
dump
public void dump(javax.jcr.NodeIterator it, JSONWriter w) throws javax.jcr.RepositoryException, JSONExceptionDump all Nodes of given NodeIterator in JSON- Parameters:
it-NodeIteratorw-JSONWriter- Throws:
javax.jcr.RepositoryException- if some error occursJSONException- if some error occurs
-
dump
public void dump(javax.jcr.NodeIterator it, java.io.Writer out) throws javax.jcr.RepositoryException, JSONExceptionDump all Nodes of given NodeIterator in JSON- Overrides:
dumpin classJsonItemWriter- Throws:
JSONExceptionjavax.jcr.RepositoryException
-
dump
public void dump(javax.jcr.Property p, JSONWriter w) throws JSONException, javax.jcr.RepositoryExceptionDump the property in JSON- Parameters:
p- property to dumpw-JSONWriter- Throws:
javax.jcr.RepositoryException- if some error occursJSONException- if some error occurs
-
dump
public void dump(javax.jcr.Property p, java.io.Writer w) throws JSONException, javax.jcr.ValueFormatException, javax.jcr.RepositoryExceptionDump given property in JSON- Overrides:
dumpin classJsonItemWriter- Throws:
JSONExceptionjavax.jcr.ValueFormatExceptionjavax.jcr.RepositoryException
-
-