public class KvJsonEscaper extends Object
a=1 b={"a":1, "b"=1} c=[{"a":1, "b":2}] f="toto, tata"
One cannot simply escape what is inside quotes, the '[', ']', '{' and '}' must be considered toĆ .
This JSON aware escaper results in the following escape string and extracted substrings:
a=1 b=@PUNCH@ c=@PUNCH@ f=@PUNCH@
opaque[0] {"a":1, "b"=1}
opaque[1] [{"a":1, "b":2}]
opaque[2] "toto, tata"
Constructor and Description |
---|
KvJsonEscaper(String delimiter,
char escapeCharacter) |
Modifier and Type | Method and Description |
---|---|
String |
escape(String input,
List<KvPortion> escapedList)
Escape the provided string and return a list of portions.
|
static String |
restore(String value,
List<KvPortion> opaque) |
public KvJsonEscaper(String delimiter, char escapeCharacter)
public String escape(String input, List<KvPortion> escapedList)
input
- the input stringescapedList
- the out list of portionsCopyright © 2023. All rights reserved.