Package com.adobe.granite.xss
Class JSONUtil
- java.lang.Object
-
- com.adobe.granite.xss.JSONUtil
-
@Deprecated public class JSONUtil extends java.lang.ObjectDeprecated.Theorg.apache.sling.commons.jsonAPI is deprecated.JSON utilities Support for handling xss protected values with JSON objects and JSON writers.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringKEY_SUFFIX_XSSDeprecated.Key suffix for XSS protected properties
-
Constructor Summary
Constructors Constructor Description JSONUtil()Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidputProtected(JSONObject object, java.lang.String key, java.lang.String value, XSSFilter xss)Deprecated.Puts a xss protected value into a JSON object.static voidputWithProtected(JSONObject object, java.lang.String key, java.lang.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, java.lang.String key, java.lang.String[] values, XSSFilter xss)Deprecated.Writes a xss protected value array into a JSON writer.static voidwriteProtected(JSONWriter writer, java.lang.String key, java.lang.String value, XSSFilter xss)Deprecated.Writes a xss protected value into a JSON writer.static voidwriteWithProtected(JSONWriter writer, java.lang.String key, java.lang.String[] values, XSSFilter xss)Deprecated.Writes a value array into a JSON write.static voidwriteWithProtected(JSONWriter writer, java.lang.String key, java.lang.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 Detail
-
KEY_SUFFIX_XSS
public static final java.lang.String KEY_SUFFIX_XSS
Deprecated.Key suffix for XSS protected properties- See Also:
- Constant Field Values
-
-
Method Detail
-
putProtected
public static void putProtected(JSONObject object, java.lang.String key, java.lang.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 objectjava.lang.NullPointerException- If xss protection filter isnull
-
putWithProtected
public static void putWithProtected(JSONObject object, java.lang.String key, java.lang.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 objectjava.lang.NullPointerException- If xss protection filter isnull
-
writeProtected
public static void writeProtected(JSONWriter writer, java.lang.String key, java.lang.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 writtenjava.lang.NullPointerException- If xss protection filter isnull
-
writeProtected
public static void writeProtected(JSONWriter writer, java.lang.String key, java.lang.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.java.lang.NullPointerException- If xss protection filter isnull
-
writeWithProtected
public static void writeWithProtected(JSONWriter writer, java.lang.String key, java.lang.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 writtenjava.lang.NullPointerException- If xss protection filter isnull
-
writeWithProtected
public static void writeWithProtected(JSONWriter writer, java.lang.String key, java.lang.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.java.lang.NullPointerException- If xss protection filter isnull
-
-