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
Extension of the JsonItemWriter that uses a
TidyJSONWriter.-
Field Summary
Fields inherited from class org.apache.sling.commons.json.jcr.JsonItemWriter
DATE_FORMAT_LOCALE, ECMA_DATE_FORMAT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(NodeIterator it, Writer out) Dump all Nodes of given NodeIterator in JSONvoiddump(NodeIterator it, JSONWriter w) Dump all Nodes of given NodeIterator in JSONvoidDump given node in JSON, optionally recursing into its child nodesvoiddump(Node node, JSONWriter w, int maxRecursionLevels) Dump given node in JSON, optionally recursing into its child nodesvoidDump given property in JSONvoiddump(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 Details
-
TidyJsonItemWriter
Constructor- Parameters:
propertyNamesToIgnore- See javadoc of constructor ofJsonItemWriter
-
-
Method Details
-
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(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-JSONWritermaxRecursionLevels- max recursion level- Throws:
RepositoryException- if some error occursJSONException- if some error occurs
-
dump
public void dump(Node node, Writer w, int maxRecursionLevels) throws RepositoryException, JSONException Dump given node in JSON, optionally recursing into its child nodes- Overrides:
dumpin classJsonItemWriter- Throws:
RepositoryExceptionJSONException
-
dump
Dump all Nodes of given NodeIterator in JSON- Parameters:
it-NodeIteratorw-JSONWriter- Throws:
RepositoryException- if some error occursJSONException- if some error occurs
-
dump
Dump all Nodes of given NodeIterator in JSON- Overrides:
dumpin classJsonItemWriter- Throws:
JSONExceptionRepositoryException
-
dump
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, Writer w) throws JSONException, ValueFormatException, RepositoryException Dump given property in JSON- Overrides:
dumpin classJsonItemWriter- Throws:
JSONExceptionValueFormatExceptionRepositoryException
-