|
29 | 29 | import java.util.function.Function;
|
30 | 30 | import java.util.stream.Stream;
|
31 | 31 |
|
| 32 | +import com.fasterxml.jackson.databind.JsonNode; |
| 33 | +import com.fasterxml.jackson.databind.node.ObjectNode; |
32 | 34 | import org.slf4j.LoggerFactory;
|
33 | 35 |
|
34 | 36 | import com.vaadin.flow.component.UI;
|
|
39 | 41 | import com.vaadin.flow.dom.DomListenerRegistration;
|
40 | 42 | import com.vaadin.flow.function.SerializableRunnable;
|
41 | 43 | import com.vaadin.flow.internal.ConstantPoolKey;
|
42 |
| -import com.vaadin.flow.internal.JsonUtils; |
| 44 | +import com.vaadin.flow.internal.JacksonUtils; |
43 | 45 | import com.vaadin.flow.internal.StateNode;
|
44 | 46 | import com.vaadin.flow.shared.JsonConstants;
|
45 | 47 |
|
46 |
| -import elemental.json.Json; |
47 | 48 | import elemental.json.JsonObject;
|
48 |
| -import elemental.json.JsonValue; |
49 | 49 |
|
50 | 50 | /**
|
51 | 51 | * Map of DOM events with server-side listeners. The key set of this map
|
@@ -81,24 +81,24 @@ public void addDebouncePhases(int timeout, Set<DebouncePhase> phases) {
|
81 | 81 | });
|
82 | 82 | }
|
83 | 83 |
|
84 |
| - public JsonValue toJson() { |
| 84 | + public JsonNode toJson() { |
85 | 85 | if (debounceSettings.isEmpty()) {
|
86 |
| - return Json.create(false); |
| 86 | + return JacksonUtils.createNode(false); |
87 | 87 | } else if (debounceSettings.size() == 1
|
88 | 88 | && debounceSettings.containsKey(Integer.valueOf(0))) {
|
89 | 89 | // Shorthand if only debounce is a dummy filter debounce
|
90 |
| - return Json.create(true); |
| 90 | + return JacksonUtils.createNode(true); |
91 | 91 | } else {
|
92 | 92 | // [[timeout1, phase1, phase2, ...], [timeout2, phase1, ...]]
|
93 | 93 | return debounceSettings.entrySet().stream()
|
94 | 94 | .map(entry -> Stream.concat(
|
95 |
| - Stream.of( |
96 |
| - Json.create(entry.getKey().intValue())), |
| 95 | + Stream.of(JacksonUtils |
| 96 | + .createNode(entry.getKey().intValue())), |
97 | 97 | entry.getValue().stream()
|
98 | 98 | .map(DebouncePhase::getIdentifier)
|
99 |
| - .map(Json::create)) |
100 |
| - .collect(JsonUtils.asArray())) |
101 |
| - .collect(JsonUtils.asArray()); |
| 99 | + .map(JacksonUtils::createNode)) |
| 100 | + .collect(JacksonUtils.asArray())) |
| 101 | + .collect(JacksonUtils.asArray()); |
102 | 102 | }
|
103 | 103 |
|
104 | 104 | }
|
@@ -393,7 +393,7 @@ private Map<String, ExpressionSettings> collectEventExpressions(
|
393 | 393 | private void updateEventSettings(String eventType) {
|
394 | 394 | Map<String, ExpressionSettings> eventSettings = collectEventExpressions(
|
395 | 395 | eventType);
|
396 |
| - JsonObject eventSettingsJson = JsonUtils.createObject(eventSettings, |
| 396 | + ObjectNode eventSettingsJson = JacksonUtils.createObject(eventSettings, |
397 | 397 | ExpressionSettings::toJson);
|
398 | 398 |
|
399 | 399 | ConstantPoolKey constantPoolKey = new ConstantPoolKey(
|
|
0 commit comments