Fixed JSON escaping quoutes and some javadoc fixes

This commit is contained in:
Ziver Koc 2023-03-29 01:08:20 +02:00
parent 942e26bb53
commit 86296df176
2 changed files with 5 additions and 2 deletions

View file

@ -7,10 +7,11 @@ import java.util.ArrayList;
import java.util.List;
/**
* This is a class that implements the JSONPath syntax to lookup eöements of a DataNode structure.
* This is a class that implements the JSONPath syntax to lookup elements of a DataNode structure.
* <br>
* Operators (From JSONPath spec):
* <table>
* <caption>Table describing operator</caption>
* <tr><th>Operator</th><th>Description</th></tr>
* <tr><td><code>$</code></td><td>The root element to query. This starts all path expressions.</td></tr>
* <tr><td><code>*</code></td><td>Wildcard. Available anywhere a name or numeric are required.</td></tr>
@ -21,6 +22,7 @@ import java.util.List;
*
* Examples:
* <table>
* <caption>Table with example JSON paths</caption>
* <tr><td> <strong>JSONPath</strong> </td><td> <strong>Result</strong> </td></tr>
* <tr><td class="lft"><code>$.store.book[*].author</code> </td><td class="lft">a list of all authors for the books in the store </td></tr>
* <tr><td class="lft"><code>$.store.*</code> </td><td class="lft">all things in store, which are some books and a red bicycle. </td></tr>

View file

@ -121,7 +121,8 @@ public class JSONWriter{
private static String escapeString(String str) {
// Replace one backslash with two
return str.replaceAll("\\\\", "\\\\\\\\");
return str.replaceAll("\\\\", "\\\\\\\\")
.replaceAll("\"", "\\\\\"");
}
/**