Class JsonJcrNode
- java.lang.Object
-
- org.apache.sling.commons.json.JSONObject
-
- org.apache.sling.commons.json.jcr.JsonJcrNode
-
@Deprecated public class JsonJcrNode extends JSONObject
Deprecated.This class makes it easy to create a JSON object out of a JCR node. It is a shameless copy ofJsonItemWriter
, but instead of writing the resulting JSON directly to an output, you get a JSONObject that you can deal with.- Since:
- Apr 17, 2009 6:55:30 PM
-
-
Field Summary
-
Fields inherited from class org.apache.sling.commons.json.JSONObject
NULL
-
-
Constructor Summary
Constructors Constructor Description JsonJcrNode(Node node)
Deprecated.Creates a JSONObject out ofnode
.JsonJcrNode(Node node, java.util.Set<java.lang.String> propertyNamesToIgnore)
Deprecated.Creates aJSONObject
out ofnode
.
-
Method Summary
-
Methods inherited from class org.apache.sling.commons.json.JSONObject
accumulate, append, doubleToString, get, getBoolean, getDouble, getInt, getJSONArray, getJSONObject, getLong, getString, has, isNull, keys, length, names, numberToString, opt, optBoolean, optBoolean, optDouble, optDouble, optInt, optInt, optJSONArray, optJSONObject, optLong, optLong, optString, optString, put, put, put, put, put, put, put, putOpt, quote, remove, toJSONArray, toString, toString, valueToString, write
-
-
-
-
Constructor Detail
-
JsonJcrNode
public JsonJcrNode(Node node) throws JSONException, RepositoryException
Deprecated.Creates a JSONObject out ofnode
. Allnode
's properties will be reflected in the JSON object. In addition, propertiesjcr:path
andjcr:name
are added. Their values are those returned bynode.getPath()
andnode.getName()
, respectively.- Parameters:
node
- The JCR node to use- Throws:
JSONException
- If there's a problem generating the JSON objectRepositoryException
- If there's a problem reading data from the JCR repository
-
JsonJcrNode
public JsonJcrNode(Node node, java.util.Set<java.lang.String> propertyNamesToIgnore) throws JSONException, RepositoryException
Deprecated.Creates aJSONObject
out ofnode
. Allnode
's properties will be reflected in the JSON object, except those inpropertyNamesToIgnore
. In addition, propertiesjcr:path
andjcr:name
are added. Their values are those returned bynode.getPath()
andnode.getName()
, respectively.- Parameters:
node
- The JCR node to usepropertyNamesToIgnore
- A set of property names that should not be reflected in the resulting JSON object.- Throws:
JSONException
- If there's a problem generating the JSON objectRepositoryException
- If there's a problem reading data from the JCR repository
-
-