Class JsonItemWriter
java.lang.Object
org.apache.sling.commons.json.jcr.JsonItemWriter
Deprecated.
Dumps JCR Items as JSON data. The dump methods are threadsafe.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJsonItemWriter(Set<String> propertyNamesToIgnore) Deprecated.Create a JsonItemWriter -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.Dump all Nodes of given NodeIterator in JSONvoidDeprecated.Dump given node in JSON, optionally recursing into its child nodesvoidDeprecated.the tidy mode was removed from the json libraryprotected voiddump(javax.jcr.Node node, JSONWriter w, int currentRecursionLevel, int maxRecursionLevels) Deprecated.Dump given node in JSON, optionally recursing into its child nodesvoidDeprecated.Dump given property in JSONprotected voiddumpSingleNode(javax.jcr.Node n, JSONWriter w, int currentRecursionLevel, int maxRecursionLevels) Deprecated.Dump a single nodeprotected voiddumpValue(JSONWriter w, javax.jcr.Value v) Deprecated.Writes the given value to the JSON writer.static StringDeprecated.protected booleanrecursionLevelActive(int currentRecursionLevel, int maxRecursionLevels) Deprecated.true if the current recursion level is activeprotected voidwriteProperty(JSONWriter w, javax.jcr.Property p) Deprecated.Write a single property
-
Field Details
-
ECMA_DATE_FORMAT
Deprecated.Used to format date values- See Also:
-
DATE_FORMAT_LOCALE
Deprecated.Used to format date values
-
-
Constructor Details
-
JsonItemWriter
Deprecated.Create a JsonItemWriter- Parameters:
propertyNamesToIgnore- if not null, a property having a name from this set of values is ignored. TODO we should use a filtering interface to make the selection of which Nodes and Properties to dump more flexible.
-
-
Method Details
-
dump
public void dump(javax.jcr.NodeIterator it, Writer out) throws javax.jcr.RepositoryException, JSONException Deprecated.Dump all Nodes of given NodeIterator in JSON- Throws:
JSONExceptionjavax.jcr.RepositoryException
-
dump
public void dump(javax.jcr.Node node, Writer w, int maxRecursionLevels) throws javax.jcr.RepositoryException, JSONException Deprecated.Dump given node in JSON, optionally recursing into its child nodes- Throws:
javax.jcr.RepositoryExceptionJSONException
-
dump
@Deprecated public void dump(javax.jcr.Node node, Writer w, int maxRecursionLevels, boolean tidy) throws javax.jcr.RepositoryException, JSONException Deprecated.the tidy mode was removed from the json libraryDump given node in JSON, optionally recursing into its child nodes- Parameters:
tidy- iftruethe json dump is nicely formatted- Throws:
javax.jcr.RepositoryExceptionJSONException
-
dump
public void dump(javax.jcr.Property p, Writer w) throws JSONException, javax.jcr.ValueFormatException, javax.jcr.RepositoryException Deprecated.Dump given property in JSON- Throws:
JSONExceptionjavax.jcr.ValueFormatExceptionjavax.jcr.RepositoryException
-
dump
protected void dump(javax.jcr.Node node, JSONWriter w, int currentRecursionLevel, int maxRecursionLevels) throws javax.jcr.RepositoryException, JSONException Deprecated.Dump given node in JSON, optionally recursing into its child nodes- Throws:
javax.jcr.RepositoryExceptionJSONException
-
dumpSingleNode
protected void dumpSingleNode(javax.jcr.Node n, JSONWriter w, int currentRecursionLevel, int maxRecursionLevels) throws javax.jcr.RepositoryException, JSONException Deprecated.Dump a single node- Throws:
javax.jcr.RepositoryExceptionJSONException
-
recursionLevelActive
protected boolean recursionLevelActive(int currentRecursionLevel, int maxRecursionLevels) Deprecated.true if the current recursion level is active -
writeProperty
protected void writeProperty(JSONWriter w, javax.jcr.Property p) throws javax.jcr.ValueFormatException, javax.jcr.RepositoryException, JSONException Deprecated.Write a single property- Throws:
javax.jcr.ValueFormatExceptionjavax.jcr.RepositoryExceptionJSONException
-
dumpValue
protected void dumpValue(JSONWriter w, javax.jcr.Value v) throws javax.jcr.ValueFormatException, IllegalStateException, javax.jcr.RepositoryException, JSONException Deprecated.Writes the given value to the JSON writer. currently the following conversions are done:
1 Currently not implemented and uses 0 as default.JSR Property Type JSON Value Type BINARY always 0 as long DATE converted date string as defined by ECMA BOOLEAN boolean LONG long DOUBLE double all other string - Parameters:
w- json writerv- value to dump- Throws:
javax.jcr.ValueFormatExceptionIllegalStateExceptionjavax.jcr.RepositoryExceptionJSONException
-
format
Deprecated.
-