@Deprecated public final class JSONUtil extends Object
Support for handling xss protected values with JSON objects and JSON writers.
Modifier and Type | Field and Description |
---|---|
static String |
KEY_SUFFIX_XSS
Deprecated.
Key suffix for XSS protected properties
|
Modifier and Type | Method and Description |
---|---|
static void |
putProtected(org.apache.sling.commons.json.JSONObject object,
String key,
String value,
XSSFilter xss)
Deprecated.
Puts a xss protected value into a JSON object.
|
static void |
putWithProtected(org.apache.sling.commons.json.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 by
KEY_SUFFIX_XSS |
static void |
writeProtected(org.apache.sling.commons.json.io.JSONWriter writer,
String key,
String[] values,
XSSFilter xss)
Deprecated.
Writes a xss protected value array into a JSON writer.
|
static void |
writeProtected(org.apache.sling.commons.json.io.JSONWriter writer,
String key,
String value,
XSSFilter xss)
Deprecated.
Writes a xss protected value into a JSON writer.
|
static void |
writeWithProtected(org.apache.sling.commons.json.io.JSONWriter writer,
String key,
String[] values,
XSSFilter xss)
Deprecated.
Writes a value array into a JSON write.
|
static void |
writeWithProtected(org.apache.sling.commons.json.io.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 by
KEY_SUFFIX_XSS |
public static final String KEY_SUFFIX_XSS
public static void putProtected(org.apache.sling.commons.json.JSONObject object, String key, String value, XSSFilter xss) throws org.apache.sling.commons.json.JSONException
object
- JSON objectkey
- Key to writevalue
- Value to writexss
- XSS protection filterorg.apache.sling.commons.json.JSONException
- If value could not be put into the objectNullPointerException
- If xss protection filter is null
public static void putWithProtected(org.apache.sling.commons.json.JSONObject object, String key, String value, XSSFilter xss) throws org.apache.sling.commons.json.JSONException
KEY_SUFFIX_XSS
object
- JSON objectkey
- Key to writevalue
- Value to writexss
- XSS protection filterorg.apache.sling.commons.json.JSONException
- If value could not be put into the objectNullPointerException
- If xss protection filter is null
public static void writeProtected(org.apache.sling.commons.json.io.JSONWriter writer, String key, String value, XSSFilter xss) throws org.apache.sling.commons.json.JSONException
writer
- JSON writerkey
- Key to writevalue
- Value to writexss
- XSS protection filterorg.apache.sling.commons.json.JSONException
- If value could not be writtenNullPointerException
- If xss protection filter is null
public static void writeProtected(org.apache.sling.commons.json.io.JSONWriter writer, String key, String[] values, XSSFilter xss) throws org.apache.sling.commons.json.JSONException
writer
- The JSON writer.key
- Key to use.values
- The value arrays.xss
- The XSS protection filter.org.apache.sling.commons.json.JSONException
- If an JSON specific error occurs.NullPointerException
- If xss protection filter is null
public static void writeWithProtected(org.apache.sling.commons.json.io.JSONWriter writer, String key, String value, XSSFilter xss) throws org.apache.sling.commons.json.JSONException
KEY_SUFFIX_XSS
writer
- JSON writerkey
- Key to writevalue
- Value to writexss
- XSS protection filterorg.apache.sling.commons.json.JSONException
- If value could not be writtenNullPointerException
- If xss protection filter is null
public static void writeWithProtected(org.apache.sling.commons.json.io.JSONWriter writer, String key, String[] values, XSSFilter xss) throws org.apache.sling.commons.json.JSONException
KEY_SUFFIX_XSS
writer
- The JSON writer to use.key
- The key to write.values
- The value array.xss
- The xss protection filter.org.apache.sling.commons.json.JSONException
- If a JSON specific error occurs.NullPointerException
- If xss protection filter is null
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.