Package org.apache.tomcat.util.json
Class JSONFilter
java.lang.Object
org.apache.tomcat.util.json.JSONFilter
Provides escaping of values so they can be included in a JSON document.
 Escaping is based on the definition of JSON found in
 RFC 8259.
- 
Method SummaryModifier and TypeMethodDescriptionstatic char[]escape(char c) Escape the given char.static CharSequenceescape(CharSequence input) Escape the given char sequence.static CharSequenceescape(CharSequence input, int off, int length) Escape the given char sequence.static StringEscape the given string.
- 
Method Details- 
escapepublic static char[] escape(char c) Escape the given char.- Parameters:
- c- the char
- Returns:
- a char array with the escaped sequence
 
- 
escapeEscape the given string.- Parameters:
- input- the string
- Returns:
- the escaped string
 
- 
escapeEscape the given char sequence.- Parameters:
- input- the char sequence
- Returns:
- the escaped char sequence
 
- 
escapeEscape the given char sequence.- Parameters:
- input- the char sequence
- off- the offset on which escaping will start
- length- the length which should be escaped
- Returns:
- the escaped char sequence corresponding to the specified range
 
 
-