Package com.adobe.granite.xss
Class JSONUtil
java.lang.Object
com.adobe.granite.xss.JSONUtil
Deprecated.
JSON utilities
Support for handling xss protected values with JSON objects and JSON writers.
- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.Key suffix for XSS protected properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidputProtected(JSONObject object, String key, String value, XSSFilter xss) Deprecated.Puts a xss protected value into a JSON object.static voidputWithProtected(JSONObject object, String key, String value, XSSFilter xss) Deprecated.Puts a value into a JSON object In addition, the xss protected value is put under the provided key appended byKEY_SUFFIX_XSSstatic voidwriteProtected(JSONWriter writer, String key, String[] values, XSSFilter xss) Deprecated.Writes a xss protected value array into a JSON writer.static voidwriteProtected(JSONWriter writer, String key, String value, XSSFilter xss) Deprecated.Writes a xss protected value into a JSON writer.static voidwriteWithProtected(JSONWriter writer, String key, String[] values, XSSFilter xss) Deprecated.Writes a value array into a JSON write.static voidwriteWithProtected(JSONWriter writer, String key, String value, XSSFilter xss) Deprecated.Writes a value into a JSON write In addition, the xss protected value is written with the provided key appended byKEY_SUFFIX_XSS
-
Field Details
-
KEY_SUFFIX_XSS
Deprecated.Key suffix for XSS protected properties- See Also:
-
-
Constructor Details
-
JSONUtil
public JSONUtil()Deprecated.
-
-
Method Details
-
putProtected
public static void putProtected(JSONObject object, String key, String value, XSSFilter xss) throws JSONException Deprecated.Puts a xss protected value into a JSON object. The value is put under the provided key.- Parameters:
object- JSON objectkey- Key to writevalue- Value to writexss- XSS protection filter- Throws:
JSONException- If value could not be put into the objectNullPointerException- If xss protection filter isnull
-
putWithProtected
public static void putWithProtected(JSONObject object, String key, String value, XSSFilter xss) throws JSONException Deprecated.Puts a value into a JSON object In addition, the xss protected value is put under the provided key appended byKEY_SUFFIX_XSS- Parameters:
object- JSON objectkey- Key to writevalue- Value to writexss- XSS protection filter- Throws:
JSONException- If value could not be put into the objectNullPointerException- If xss protection filter isnull
-
writeProtected
public static void writeProtected(JSONWriter writer, String key, String value, XSSFilter xss) throws JSONException Deprecated.Writes a xss protected value into a JSON writer. The value is written under the provided key.- Parameters:
writer- JSON writerkey- Key to writevalue- Value to writexss- XSS protection filter- Throws:
JSONException- If value could not be writtenNullPointerException- If xss protection filter isnull
-
writeProtected
public static void writeProtected(JSONWriter writer, String key, String[] values, XSSFilter xss) throws JSONException Deprecated.Writes a xss protected value array into a JSON writer. The values are written under the provided key.- Parameters:
writer- The JSON writer.key- Key to use.values- The value arrays.xss- The XSS protection filter.- Throws:
JSONException- If an JSON specific error occurs.NullPointerException- If xss protection filter isnull
-
writeWithProtected
public static void writeWithProtected(JSONWriter writer, String key, String value, XSSFilter xss) throws JSONException Deprecated.Writes a value into a JSON write In addition, the xss protected value is written with the provided key appended byKEY_SUFFIX_XSS- Parameters:
writer- JSON writerkey- Key to writevalue- Value to writexss- XSS protection filter- Throws:
JSONException- If value could not be writtenNullPointerException- If xss protection filter isnull
-
writeWithProtected
public static void writeWithProtected(JSONWriter writer, String key, String[] values, XSSFilter xss) throws JSONException Deprecated.Writes a value array into a JSON write. In addition, the xss protected values are written with the provided key appended byKEY_SUFFIX_XSS- Parameters:
writer- The JSON writer to use.key- The key to write.values- The value array.xss- The xss protection filter.- Throws:
JSONException- If a JSON specific error occurs.NullPointerException- If xss protection filter isnull
-
org.apache.sling.commons.jsonAPI is deprecated.