children(JsonObject o) {
public JsonType getType() {
return JsonType.OBJECT;
}
-
}
-
-
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/ElementalPendingJavaScriptResult.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/ElementalPendingJavaScriptResult.java
index 93ff64e..2980564 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/ElementalPendingJavaScriptResult.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/ElementalPendingJavaScriptResult.java
@@ -18,6 +18,7 @@
* #L%
*/
package com.flowingcode.vaadin.jsonmigration;
+
/*
* Copyright 2000-2025 Vaadin Ltd.
*
@@ -36,7 +37,6 @@
import com.vaadin.flow.component.page.PendingJavaScriptResult;
import com.vaadin.flow.function.SerializableConsumer;
-import com.vaadin.flow.internal.JsonCodec;
import elemental.json.JsonValue;
import java.io.Serializable;
import java.util.concurrent.CompletableFuture;
@@ -51,132 +51,107 @@
*/
public interface ElementalPendingJavaScriptResult extends Serializable {
- /**
- * Adds an untyped handler that will be run for a successful execution and a
- * handler that will be run for a failed execution. One of the handlers will
- * be invoked asynchronously when the result of the execution is sent back
- * to the server. It is not possible to synchronously wait for the result of
- * the execution while holding the session lock since the request handling
- * thread that makes the result available will also need to lock the
- * session.
- *
- * Handlers can only be added before the execution has been sent to the
- * browser.
- *
- * @param resultHandler
- * a handler for the JSON representation of the value from a
- * successful execution, not null
- * @param errorHandler
- * a handler for an error message in case the execution failed,
- * or null to ignore errors
- */
- void then(SerializableConsumer resultHandler,
- SerializableConsumer errorHandler);
-
- /**
- * Adds an untyped handler that will be run for a successful execution. The
- * handler will be invoked asynchronously if the execution was successful.
- * In case of a failure, no handler will be run.
- *
- * A handler can only be added before the execution has been sent to the
- * browser.
- *
- * @param resultHandler
- * a handler for the JSON representation of the return value from
- * a successful execution, not null
- */
- default void then(SerializableConsumer resultHandler) {
- then(resultHandler, null);
- }
-
- /**
- * Adds a typed handler that will be run for a successful execution and a
- * handler that will be run for a failed execution. One of the handlers will
- * be invoked asynchronously when the result of the execution is sent back
- * to the server.
- *
- * Handlers can only be added before the execution has been sent to the
- * browser.
- *
- * @param targetType
- * the type to convert the JavaScript return value to, not
- * null
- * @param resultHandler
- * a handler for the return value from a successful execution,
- * not null
- * @param errorHandler
- * a handler for an error message in case the execution failed,
- * or null to ignore errors
- */
- default void then(Class targetType,
- SerializableConsumer resultHandler,
- SerializableConsumer errorHandler) {
- if (targetType == null) {
- throw new IllegalArgumentException("Target type cannot be null");
- }
- if (resultHandler == null) {
- throw new IllegalArgumentException("Result handler cannot be null");
- }
+ /**
+ * Adds an untyped handler that will be run for a successful execution and a handler that will be
+ * run for a failed execution. One of the handlers will be invoked asynchronously when the result
+ * of the execution is sent back to the server. It is not possible to synchronously wait for the
+ * result of the execution while holding the session lock since the request handling thread that
+ * makes the result available will also need to lock the session.
+ *
+ * Handlers can only be added before the execution has been sent to the browser.
+ *
+ * @param resultHandler a handler for the JSON representation of the value from a successful
+ * execution, not null
+ * @param errorHandler a handler for an error message in case the execution failed, or null
+ * to ignore errors
+ */
+ void then(
+ SerializableConsumer resultHandler, SerializableConsumer errorHandler);
- SerializableConsumer convertingResultHandler = value -> resultHandler
- .accept(JsonCodec.decodeAs(value, targetType));
+ /**
+ * Adds an untyped handler that will be run for a successful execution. The handler will be
+ * invoked asynchronously if the execution was successful. In case of a failure, no handler will
+ * be run.
+ *
+ * A handler can only be added before the execution has been sent to the browser.
+ *
+ * @param resultHandler a handler for the JSON representation of the return value from a
+ * successful execution, not null
+ */
+ default void then(SerializableConsumer resultHandler) {
+ then(resultHandler, null);
+ }
- then(convertingResultHandler, errorHandler);
+ /**
+ * Adds a typed handler that will be run for a successful execution and a handler that will be run
+ * for a failed execution. One of the handlers will be invoked asynchronously when the result of
+ * the execution is sent back to the server.
+ *
+ * Handlers can only be added before the execution has been sent to the browser.
+ *
+ * @param targetType the type to convert the JavaScript return value to, not null
+ * @param resultHandler a handler for the return value from a successful execution, not null
+ *
+ * @param errorHandler a handler for an error message in case the execution failed, or null
+ * to ignore errors
+ */
+ default void then(
+ Class targetType,
+ SerializableConsumer resultHandler,
+ SerializableConsumer errorHandler) {
+ if (targetType == null) {
+ throw new IllegalArgumentException("Target type cannot be null");
}
-
- /**
- * Adds a typed handler that will be run for a successful execution. The
- * handler will be invoked asynchronously if the execution was successful.
- * In case of a failure, no handler will be run.
- *
- * A handler can only be added before the execution has been sent to the
- * browser.
- *
- * @param targetType
- * the type to convert the JavaScript return value to, not
- * null
- * @param resultHandler
- * a handler for the return value from a successful execution,
- * not null
- */
- default void then(Class targetType,
- SerializableConsumer resultHandler) {
- then(targetType, resultHandler, null);
+ if (resultHandler == null) {
+ throw new IllegalArgumentException("Result handler cannot be null");
}
- /**
- * Creates a typed completable future that will be completed with the result
- * of the execution. It will be completed asynchronously when the result of
- * the execution is sent back to the server. It is not possible to
- * synchronously wait for the result of the execution while holding the
- * session lock since the request handling thread that makes the result
- * available will also need to lock the session.
- *
- * A completable future can only be created before the execution has been
- * sent to the browser.
- *
- * @param targetType
- * the type to convert the JavaScript return value to, not
- * null
- *
- * @return a completable future that will be completed based on the
- * execution results, not null
- */
- CompletableFuture toCompletableFuture(Class targetType);
+ SerializableConsumer convertingResultHandler =
+ value -> resultHandler.accept(JsonCodec.decodeAs(value, targetType));
- /**
- * Creates an untyped completable future that will be completed with the
- * result of the execution. It will be completed asynchronously when the
- * result of the execution is sent back to the server.
- *
- * A completable future can only be created before the execution has been
- * sent to the browser.
- *
- * @return a completable future that will be completed based on the
- * execution results, not null
- */
- default CompletableFuture toCompletableFuture() {
- return toCompletableFuture(JsonValue.class);
- }
+ then(convertingResultHandler, errorHandler);
+ }
+
+ /**
+ * Adds a typed handler that will be run for a successful execution. The handler will be invoked
+ * asynchronously if the execution was successful. In case of a failure, no handler will be run.
+ *
+ * A handler can only be added before the execution has been sent to the browser.
+ *
+ * @param targetType the type to convert the JavaScript return value to, not null
+ * @param resultHandler a handler for the return value from a successful execution, not null
+ *
+ */
+ default void then(Class targetType, SerializableConsumer resultHandler) {
+ then(targetType, resultHandler, null);
+ }
+
+ /**
+ * Creates a typed completable future that will be completed with the result of the execution. It
+ * will be completed asynchronously when the result of the execution is sent back to the server.
+ * It is not possible to synchronously wait for the result of the execution while holding the
+ * session lock since the request handling thread that makes the result available will also need
+ * to lock the session.
+ *
+ * A completable future can only be created before the execution has been sent to the browser.
+ *
+ * @param targetType the type to convert the JavaScript return value to, not null
+ * @return a completable future that will be completed based on the execution results, not
+ * null
+ */
+ CompletableFuture toCompletableFuture(Class targetType);
+ /**
+ * Creates an untyped completable future that will be completed with the result of the execution.
+ * It will be completed asynchronously when the result of the execution is sent back to the
+ * server.
+ *
+ * A completable future can only be created before the execution has been sent to the browser.
+ *
+ * @return a completable future that will be completed based on the execution results, not
+ * null
+ */
+ default CompletableFuture toCompletableFuture() {
+ return toCompletableFuture(JsonValue.class);
+ }
}
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/ElementalStringNode.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/ElementalStringNode.java
index 7e80173..7c33b09 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/ElementalStringNode.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/ElementalStringNode.java
@@ -33,5 +33,4 @@ public ElementalStringNode(String value) {
public JsonType getType() {
return JsonType.STRING;
}
-
-}
\ No newline at end of file
+}
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/InstrumentationViewInitializer.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/InstrumentationViewInitializer.java
index 281fd8f..dac1f1e 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/InstrumentationViewInitializer.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/InstrumentationViewInitializer.java
@@ -25,8 +25,8 @@
/**
* Abstract base class for Vaadin service initializers that register instrumented views. Subclasses
- * should implement {@link #serviceInit(com.vaadin.flow.server.ServiceInitEvent)} and call
- * {@link #registerInstrumentedRoute(Class)} to register views with instrumented routes.
+ * should implement {@link #serviceInit(com.vaadin.flow.server.ServiceInitEvent)} and call {@link
+ * #registerInstrumentedRoute(Class)} to register views with instrumented routes.
*
* @author Javier Godoy / Flowing Code
*/
@@ -35,20 +35,21 @@ public abstract class InstrumentationViewInitializer implements VaadinServiceIni
/**
* Registers an instrumented route for the given navigation target. The navigation target must be
- * annotated with {@link InstrumentedRoute} to specify the route path. This method calls
- * {@link JsonMigration#instrumentClass(Class)} to get the instrumented class and registers it as
- * a Vaadin view with the route derived from the annotation.
+ * annotated with {@link InstrumentedRoute} to specify the route path. This method calls {@link
+ * JsonMigration#instrumentClass(Class)} to get the instrumented class and registers it as a
+ * Vaadin view with the route derived from the annotation.
*
* @param navigationTarget the component class to instrument and register, must be annotated with
- * {@link InstrumentedRoute}
- * @throws IllegalArgumentException if the navigationTarget is not annotated with
- * {@link InstrumentedRoute}
+ * {@link InstrumentedRoute}
+ * @throws IllegalArgumentException if the navigationTarget is not annotated with {@link
+ * InstrumentedRoute}
*/
protected final void registerInstrumentedRoute(Class extends Component> navigationTarget) {
InstrumentedRoute annotation = navigationTarget.getAnnotation(InstrumentedRoute.class);
if (annotation == null) {
throw new IllegalArgumentException(
- navigationTarget.getName() + " must be annotated with @"
+ navigationTarget.getName()
+ + " must be annotated with @"
+ InstrumentedRoute.class.getSimpleName());
}
@@ -56,5 +57,4 @@ protected final void registerInstrumentedRoute(Class extends Component> naviga
navigationTarget = JsonMigration.instrumentClass(navigationTarget);
RouteConfiguration.forApplicationScope().setRoute(route, navigationTarget);
}
-
}
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/InstrumentedRoute.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/InstrumentedRoute.java
index 4e93475..2793c26 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/InstrumentedRoute.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/InstrumentedRoute.java
@@ -42,5 +42,4 @@
* @return the route path
*/
String value();
-
}
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonCodec.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonCodec.java
index 3e7dbec..ce184a5 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonCodec.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonCodec.java
@@ -18,6 +18,7 @@
* #L%
*/
package com.flowingcode.vaadin.jsonmigration;
+
/*
* Copyright 2000-2020 Vaadin Ltd.
*
@@ -36,120 +37,109 @@
import com.vaadin.flow.component.Component;
import com.vaadin.flow.dom.Element;
-import com.vaadin.flow.dom.Node;
import com.vaadin.flow.internal.ReflectTools;
-import com.vaadin.flow.internal.nodefeature.ReturnChannelRegistration;
import elemental.json.Json;
import elemental.json.JsonType;
import elemental.json.JsonValue;
/**
* Utility for encoding objects to and from JSON.
- *
- * Supported types are
+ *
+ *
Supported types are
+ *
*
- * - {@link String}
- *
- {@link Boolean} and
boolean
- * - {@link Integer} and
int
- * - {@link Double} and
double (NaN and infinity not
- * supported)
- * - {@link JsonValue} and all its sub types
- *
- {@link Element} (encoded as a reference to the element)
- *
- {@link Component} (encoded as a reference to the root element)
+ *
- {@link String}
+ *
- {@link Boolean} and
boolean
+ * - {@link Integer} and
int
+ * - {@link Double} and
double (NaN and infinity not supported)
+ * - {@link JsonValue} and all its sub types
+ *
- {@link Element} (encoded as a reference to the element)
+ *
- {@link Component} (encoded as a reference to the root element)
*
*
*
+ *
* @author Vaadin Ltd
*/
public class JsonCodec {
- /**
- * Decodes the given JSON value as the given type.
- *
- * Supported types are {@link String}, {@link Boolean}, {@link Integer},
- * {@link Double} and primitives boolean, int, double
- *
- * @param
- * the decoded type
- * @param json
- * the JSON value
- * @param type
- * the type to decode as
- * @return the value decoded as the given type
- * @throws IllegalArgumentException
- * if the type was unsupported
- */
- @SuppressWarnings("unchecked")
- public static T decodeAs(JsonValue json, Class type) {
- assert json != null;
- if (json.getType() == JsonType.NULL && !type.isPrimitive()) {
- return null;
- }
- Class> convertedType = ReflectTools.convertPrimitiveType(type);
- if (type == String.class) {
- return type.cast(json.asString());
- } else if (convertedType == Boolean.class) {
- return (T) convertedType.cast(Boolean.valueOf(json.asBoolean()));
- } else if (convertedType == Double.class) {
- return (T) convertedType.cast(Double.valueOf(json.asNumber()));
- } else if (convertedType == Integer.class) {
- return (T) convertedType
- .cast(Integer.valueOf((int) json.asNumber()));
- } else if (JsonValue.class.isAssignableFrom(type)) {
- return type.cast(json);
- } else {
- throw new IllegalArgumentException(
- "Unknown type " + type.getName());
- }
-
+ /**
+ * Decodes the given JSON value as the given type.
+ *
+ * Supported types are {@link String}, {@link Boolean}, {@link Integer}, {@link Double} and
+ * primitives boolean, int, double
+ *
+ * @param the decoded type
+ * @param json the JSON value
+ * @param type the type to decode as
+ * @return the value decoded as the given type
+ * @throws IllegalArgumentException if the type was unsupported
+ */
+ @SuppressWarnings("unchecked")
+ public static T decodeAs(JsonValue json, Class type) {
+ assert json != null;
+ if (json.getType() == JsonType.NULL && !type.isPrimitive()) {
+ return null;
}
-
- /**
- * Helper for checking whether the type is supported by
- * {@link #encodeWithoutTypeInfo(Object)}. Supported value types are
- * {@link String}, {@link Integer}, {@link Double}, {@link Boolean},
- * {@link JsonValue}.
- *
- * @param type
- * the type to check
- * @return whether the type can be encoded
- */
- public static boolean canEncodeWithoutTypeInfo(Class> type) {
- assert type != null;
- return String.class.equals(type) || Integer.class.equals(type)
- || Double.class.equals(type) || Boolean.class.equals(type)
- || JsonValue.class.isAssignableFrom(type);
+ Class> convertedType = ReflectTools.convertPrimitiveType(type);
+ if (type == String.class) {
+ return type.cast(json.asString());
+ } else if (convertedType == Boolean.class) {
+ return (T) convertedType.cast(Boolean.valueOf(json.asBoolean()));
+ } else if (convertedType == Double.class) {
+ return (T) convertedType.cast(Double.valueOf(json.asNumber()));
+ } else if (convertedType == Integer.class) {
+ return (T) convertedType.cast(Integer.valueOf((int) json.asNumber()));
+ } else if (JsonValue.class.isAssignableFrom(type)) {
+ return type.cast(json);
+ } else {
+ throw new IllegalArgumentException("Unknown type " + type.getName());
}
+ }
- /**
- * Helper for encoding any "primitive" value that is directly supported in
- * JSON. Supported values types are {@link String}, {@link Number},
- * {@link Boolean}, {@link JsonValue}. null is also supported.
- *
- * @param value
- * the value to encode
- * @return the value encoded as JSON
- */
- public static JsonValue encodeWithoutTypeInfo(Object value) {
- if (value == null) {
- return Json.createNull();
- }
-
- assert canEncodeWithoutTypeInfo(value.getClass());
+ /**
+ * Helper for checking whether the type is supported by {@link #encodeWithoutTypeInfo(Object)}.
+ * Supported value types are {@link String}, {@link Integer}, {@link Double}, {@link Boolean},
+ * {@link JsonValue}.
+ *
+ * @param type the type to check
+ * @return whether the type can be encoded
+ */
+ public static boolean canEncodeWithoutTypeInfo(Class> type) {
+ assert type != null;
+ return String.class.equals(type)
+ || Integer.class.equals(type)
+ || Double.class.equals(type)
+ || Boolean.class.equals(type)
+ || JsonValue.class.isAssignableFrom(type);
+ }
- Class> type = value.getClass();
- if (String.class.equals(value.getClass())) {
- return Json.create((String) value);
- } else if (Integer.class.equals(type) || Double.class.equals(type)) {
- return Json.create(((Number) value).doubleValue());
- } else if (Boolean.class.equals(type)) {
- return Json.create(((Boolean) value).booleanValue());
- } else if (JsonValue.class.isAssignableFrom(type)) {
- return (JsonValue) value;
- }
- assert !canEncodeWithoutTypeInfo(type);
- throw new IllegalArgumentException(
- "Can't encode " + value.getClass() + " to json");
+ /**
+ * Helper for encoding any "primitive" value that is directly supported in JSON. Supported values
+ * types are {@link String}, {@link Number}, {@link Boolean}, {@link JsonValue}. null
+ * is also supported.
+ *
+ * @param value the value to encode
+ * @return the value encoded as JSON
+ */
+ public static JsonValue encodeWithoutTypeInfo(Object value) {
+ if (value == null) {
+ return Json.createNull();
}
+ assert canEncodeWithoutTypeInfo(value.getClass());
+
+ Class> type = value.getClass();
+ if (String.class.equals(value.getClass())) {
+ return Json.create((String) value);
+ } else if (Integer.class.equals(type) || Double.class.equals(type)) {
+ return Json.create(((Number) value).doubleValue());
+ } else if (Boolean.class.equals(type)) {
+ return Json.create(((Boolean) value).booleanValue());
+ } else if (JsonValue.class.isAssignableFrom(type)) {
+ return (JsonValue) value;
+ }
+ assert !canEncodeWithoutTypeInfo(type);
+ throw new IllegalArgumentException("Can't encode " + value.getClass() + " to json");
+ }
}
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigration.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigration.java
index e63c8c0..a63ac25 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigration.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigration.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,45 +30,46 @@
import java.io.Serializable;
import java.lang.reflect.Method;
import lombok.SneakyThrows;
+import lombok.experimental.UtilityClass;
/**
- * Provides a compatibility layer for JSON handling to abstract away breaking changes
- * introduced in Vaadin version 25.
- *
- * This utility class detects the runtime version and uses version-specific helpers
- * to ensure that code calling its methods does not need to be aware of underlying
- * Vaadin API changes.
- *
+ * Provides a compatibility layer for JSON handling to abstract away breaking changes introduced in
+ * Vaadin version 25.
+ *
+ *
This utility class detects the runtime version and uses version-specific helpers to ensure
+ * that code calling its methods does not need to be aware of underlying Vaadin API changes.
+ *
* @author Javier Godoy
*/
+@UtilityClass
public class JsonMigration {
private static final JsonMigrationHelper helper = initializeHelper();
-
+
@SneakyThrows
private static JsonMigrationHelper initializeHelper() {
- if (Version.getMajorVersion()>24) {
- Class> helperType = Class.forName(JsonMigration.class.getName()+"Helper25");
- return (JsonMigrationHelper) helperType.getConstructor().newInstance();
+ if (Version.getMajorVersion() > 24) {
+ Class> helperType = Class.forName(JsonMigration.class.getName() + "Helper25");
+ return (JsonMigrationHelper) helperType.getConstructor().newInstance();
} else {
return new LegacyJsonMigrationHelper();
}
}
-
+
private static final Class> BASE_JSON_NODE = lookup_BaseJsonNode();
private static Class> lookup_BaseJsonNode() {
- try {
+ try {
return Class.forName("tools.jackson.databind.node.BaseJsonNode");
} catch (ClassNotFoundException e) {
return null;
}
- }
-
+ }
+
/**
* Converts a given Java object into the return type of a {@link ClientCallable method}.
*
- * In Vaadin 25, this method converts {@code JsonValue} into {@code JsonNode}.
+ *
In Vaadin 25, this method converts {@code JsonValue} into {@code JsonNode}.
*
* @param object the object to convert
* @return an {@code Object} suitable to use as the result of a {@code ClientCallable} method.
@@ -80,8 +81,8 @@ public static T convertToClientCallableResult(T object) {
/**
* Converts a given Java object into a {@code JsonValue}.
*
- * This method delegates the conversion to a version-specific helper to handle
- * any differences in the serialization process.
+ *
This method delegates the conversion to a version-specific helper to handle any differences
+ * in the serialization process.
*
* @param object the object to convert
* @return the {@code JsonValue} representation of the object
@@ -94,13 +95,12 @@ public static JsonValue convertToJsonValue(Object object) {
private static Object invoke(Method method, Object instance, Object... args) {
return helper.invoke(method, instance, args);
}
-
-
+
private static Method Element_setPropertyJson = lookup_setPropertyJson();
@SneakyThrows
private static Method lookup_setPropertyJson() {
- if (Version.getMajorVersion()>24) {
+ if (Version.getMajorVersion() > 24) {
return Element.class.getMethod("setPropertyJson", String.class, BASE_JSON_NODE);
} else {
return Element.class.getMethod("setPropertyJson", String.class, JsonValue.class);
@@ -115,16 +115,16 @@ private static Method lookup_getEventData() {
}
/**
- * Sets a JSON-valued property on a given {@code Element}, transparently handling
- * version-specific method signatures.
+ * Sets a JSON-valued property on a given {@code Element}, transparently handling version-specific
+ * method signatures.
*
- *
This method uses reflection to call the appropriate {@code setPropertyJson} method
- * on the {@code Element} class, which has a different signature for its JSON
- * parameter in library versions before and after Vaadin 25.
+ *
This method uses reflection to call the appropriate {@code setPropertyJson} method on the
+ * {@code Element} class, which has a different signature for its JSON parameter in library
+ * versions before and after Vaadin 25.
*
* @param element the {@code Element} on which to set the property
- * @param name the name of the property to set
- * @param json the {@code JsonValue} to be set as the property's value
+ * @param name the name of the property to set
+ * @param json the {@code JsonValue} to be set as the property's value
*/
public static void setPropertyJson(Element element, String name, JsonValue json) {
invoke(Element_setPropertyJson, element, name, json);
@@ -151,8 +151,8 @@ private static Method lookup_executeJs() {
* @return a pending result that can be used to get a value returned from the expression
* @see Element#executeJs(String, Serializable...)
*/
- public static ElementalPendingJavaScriptResult executeJs(Element element, String expression,
- Serializable... parameters) {
+ public static ElementalPendingJavaScriptResult executeJs(
+ Element element, String expression, Serializable... parameters) {
PendingJavaScriptResult result =
(PendingJavaScriptResult) invoke(Element_executeJs, element, expression, parameters);
return helper.convertPendingJavaScriptResult(result);
@@ -170,32 +170,31 @@ public static JsonObject getEventData(DomEvent event) {
}
/**
- * Instruments a component class to ensure compatibility with Vaadin 25+ JSON handling changes
- * in {@link ClientCallable} methods.
+ * Instruments a component class to ensure compatibility with Vaadin 25+ JSON handling changes in
+ * {@link ClientCallable} methods.
*
- *
- * This method creates a dynamically generated subclass of the given component class that
+ *
This method creates a dynamically generated subclass of the given component class that
* automatically converts {@code JsonValue} return values from {@link ClientCallable} methods to
* the appropriate {@code JsonNode} type required by Vaadin 25+.
*
- *
- * Behavior by Vaadin version:
+ *
Behavior by Vaadin version:
+ *
*
- * - Vaadin 25+: Returns an instrumented subclass that overrides all
- * {@code @ClientCallable} methods returning {@code JsonValue} types. These overridden methods
- * call the parent implementation and then convert the result through
- * {@link #convertToClientCallableResult(JsonValue)} to ensure compatibility with the new
- * Jackson-based JSON API.
- * - Vaadin 24 and earlier: Returns the original class unchanged, as no instrumentation
- * is needed for the elemental.json API.
+ * - Vaadin 25+: Returns an instrumented subclass that overrides all
+ * {@code @ClientCallable} methods returning {@code JsonValue} types. These overridden
+ * methods call the parent implementation and then convert the result through {@link
+ * #convertToClientCallableResult(JsonValue)} to ensure compatibility with the new
+ * Jackson-based JSON API.
+ *
- Vaadin 24 and earlier: Returns the original class unchanged, as no instrumentation
+ * is needed for the elemental.json API.
*
*
* @param the type of the component class
* @param clazz the component class to instrument
* @return in Vaadin 25+, an instrumented subclass of {@code clazz}; in earlier versions, the
- * original {@code clazz}
+ * original {@code clazz}
* @throws IllegalArgumentException if the class does not meet the requirements for
- * instrumentation
+ * instrumentation
* @throws RuntimeException if the instrumentation fails
* @see ClientCallable
* @see InstrumentedRoute
@@ -204,5 +203,4 @@ public static JsonObject getEventData(DomEvent event) {
public static Class extends T> instrumentClass(Class clazz) {
return helper.instrumentClass(clazz);
}
-
}
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigrationHelper.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigrationHelper.java
index 00dcea1..30bad6f 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigrationHelper.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigrationHelper.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,9 +22,7 @@
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.page.PendingJavaScriptResult;
import elemental.json.JsonValue;
-
import java.lang.reflect.Method;
-import com.vaadin.flow.dom.Element;
interface JsonMigrationHelper {
@@ -37,5 +35,4 @@ interface JsonMigrationHelper {
ElementalPendingJavaScriptResult convertPendingJavaScriptResult(PendingJavaScriptResult result);
Class extends T> instrumentClass(Class clazz);
-
}
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigrationHelper25.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigrationHelper25.java
index 300bd7c..bbe4b6e 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigrationHelper25.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonMigrationHelper25.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,8 +19,6 @@
*/
package com.flowingcode.vaadin.jsonmigration;
-import java.lang.reflect.Method;
-import java.util.Arrays;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.page.PendingJavaScriptResult;
import com.vaadin.flow.function.SerializableConsumer;
@@ -29,6 +27,8 @@
import elemental.json.JsonObject;
import elemental.json.JsonValue;
import java.lang.reflect.Array;
+import java.lang.reflect.Method;
+import java.util.Arrays;
import java.util.concurrent.CompletableFuture;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
@@ -61,7 +61,7 @@ public JsonValue convertToJsonValue(Object object) {
throw new ClassCastException(
object.getClass().getName() + " cannot be converted to elemental.json.JsonObject");
}
- }
+ }
@SuppressWarnings("unchecked")
@Override
@@ -122,7 +122,6 @@ public Object invoke(Method method, Object instance, Object... args) {
return method.invoke(instance, convertedArgs);
}
-
private static T[] convertArray(Object[] array, Class extends T> newType) {
T[] convertedArray = null;
if (newType.isAssignableFrom(BaseJsonNode.class)) {
@@ -130,10 +129,11 @@ private static T[] convertArray(Object[] array, Class extends T> newType)
if (array[i] instanceof JsonValue) {
if (convertedArray == null) {
@SuppressWarnings("unchecked")
- T[] copy = (newType == Object.class)
- ? (T[]) new Object[array.length]
- : (T[]) Array.newInstance(newType, array.length);
- if (i>0) {
+ T[] copy =
+ (newType == Object.class)
+ ? (T[]) new Object[array.length]
+ : (T[]) Array.newInstance(newType, array.length);
+ if (i > 0) {
System.arraycopy(array, 0, copy, 0, i);
}
convertedArray = copy;
@@ -214,7 +214,6 @@ static BaseJsonNode convertToJsonNode(JsonValue jsonValue) {
}
}
-
@Override
public ElementalPendingJavaScriptResult convertPendingJavaScriptResult(
PendingJavaScriptResult result) {
@@ -229,8 +228,10 @@ private static final class PendingJavaScriptResultImpl
@SuppressWarnings("rawtypes")
private static SerializableConsumer wrap(SerializableConsumer resultHandler) {
- return (SerializableConsumer) node -> resultHandler.accept(convertToJsonValue(node));
- };
+ return (SerializableConsumer)
+ node -> resultHandler.accept(convertToJsonValue(node));
+ }
+ ;
private static T decodeAs(JsonNode node, Class type) {
return JsonCodec.decodeAs(convertToJsonValue(node), type);
@@ -238,19 +239,25 @@ private static T decodeAs(JsonNode node, Class type) {
@Override
@SuppressWarnings("unchecked")
- public void then(SerializableConsumer resultHandler,
- SerializableConsumer errorHandler) {
+ public void then(
+ SerializableConsumer resultHandler, SerializableConsumer errorHandler) {
delegate.then(wrap(resultHandler), errorHandler);
}
@Override
@SuppressWarnings("unchecked")
- public void then(Class targetType, SerializableConsumer resultHandler,
+ public void then(
+ Class targetType,
+ SerializableConsumer resultHandler,
SerializableConsumer errorHandler) {
if (targetType != null && JsonValue.class.isAssignableFrom(targetType)) {
- delegate.then(JsonNode.class, wrap(value->{
- resultHandler.accept(JsonCodec.decodeAs(value, targetType));
- }), errorHandler);
+ delegate.then(
+ JsonNode.class,
+ wrap(
+ value -> {
+ resultHandler.accept(JsonCodec.decodeAs(value, targetType));
+ }),
+ errorHandler);
} else {
delegate.then(targetType, resultHandler, errorHandler);
}
@@ -259,13 +266,12 @@ public void then(Class targetType, SerializableConsumer resultHandler,
@Override
public CompletableFuture toCompletableFuture(Class targetType) {
if (JsonValue.class.isAssignableFrom(targetType)) {
- return delegate.toCompletableFuture(JsonNode.class)
+ return delegate
+ .toCompletableFuture(JsonNode.class)
.thenApply(node -> decodeAs(node, targetType));
} else {
return delegate.toCompletableFuture(targetType);
}
}
-
}
-
}
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonSerializer.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonSerializer.java
index fbfef15..13d4f8c 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonSerializer.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/JsonSerializer.java
@@ -59,342 +59,312 @@
import java.util.Set;
/**
- * General-purpose serializer of Java objects to {@link JsonValue} and
- * deserializer of JsonValue to Java objects.
+ * General-purpose serializer of Java objects to {@link JsonValue} and deserializer of JsonValue to
+ * Java objects.
*
* @since 1.0
*/
public final class JsonSerializer {
- private JsonSerializer() {
+ private JsonSerializer() {}
+
+ /**
+ * Converts a Java bean, String, wrapper of primitive type or enum to a {@link JsonValue}.
+ *
+ * When a bean is used, a {@link JsonObject} is returned.
+ *
+ * @param bean Java object to be converted
+ * @return the json representation of the Java object
+ */
+ public static JsonValue toJson(Object bean) {
+ if (bean == null) {
+ return Json.createNull();
+ }
+ if (bean instanceof Collection) {
+ return toJson((Collection>) bean);
+ }
+ if (bean.getClass().isArray()) {
+ return toJsonArray(bean);
}
- /**
- * Converts a Java bean, String, wrapper of primitive type or enum to a {@link JsonValue}.
- *
- * When a bean is used, a {@link JsonObject} is returned.
- *
- * @param bean Java object to be converted
- * @return the json representation of the Java object
- */
- public static JsonValue toJson(Object bean) {
- if (bean == null) {
- return Json.createNull();
- }
- if (bean instanceof Collection) {
- return toJson((Collection>) bean);
- }
- if (bean.getClass().isArray()) {
- return toJsonArray(bean);
- }
+ Optional simpleType = tryToConvertToSimpleType(bean);
+ if (simpleType.isPresent()) {
+ return simpleType.get();
+ }
- Optional simpleType = tryToConvertToSimpleType(bean);
- if (simpleType.isPresent()) {
- return simpleType.get();
- }
+ try {
+ JsonObject json = Json.createObject();
+ Class> type = bean.getClass();
+
+ if (type.isRecord()) {
+ for (RecordComponent rc : type.getRecordComponents()) {
+ json.put(rc.getName(), toJson(rc.getAccessor().invoke(bean)));
+ }
+ } else {
+ BeanInfo info = Introspector.getBeanInfo(type);
+ for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
+ if ("class".equals(pd.getName())) {
+ continue;
+ }
+ Method reader = pd.getReadMethod();
+ if (reader != null) {
+ json.put(pd.getName(), toJson(reader.invoke(bean)));
+ }
+ }
+ }
+
+ return json;
+ } catch (Exception e) {
+ throw new IllegalArgumentException(
+ "Could not serialize object of type " + bean.getClass() + " to JsonValue", e);
+ }
+ }
+
+ /**
+ * Converts a collection of object into a {@link JsonArray}, converting each item of the
+ * collection individually.
+ *
+ * @param beans the collection of objects to be converted
+ * @return the json representation of the objects in the collectios. An empty array is returned if
+ * the input collections is null
+ */
+ public static JsonArray toJson(Collection> beans) {
+ JsonArray array = Json.createArray();
+ if (beans == null) {
+ return array;
+ }
- try {
- JsonObject json = Json.createObject();
- Class> type = bean.getClass();
-
- if (type.isRecord()) {
- for (RecordComponent rc : type.getRecordComponents()) {
- json.put(rc.getName(),
- toJson(rc.getAccessor().invoke(bean)));
- }
- } else {
- BeanInfo info = Introspector.getBeanInfo(type);
- for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
- if ("class".equals(pd.getName())) {
- continue;
- }
- Method reader = pd.getReadMethod();
- if (reader != null) {
- json.put(pd.getName(), toJson(reader.invoke(bean)));
- }
- }
- }
-
- return json;
- } catch (Exception e) {
- throw new IllegalArgumentException(
- "Could not serialize object of type " + bean.getClass()
- + " to JsonValue",
- e);
- }
+ beans.stream()
+ .map(JsonSerializer::toJson)
+ .forEachOrdered(json -> array.set(array.length(), json));
+ return array;
+ }
+
+ private static JsonArray toJsonArray(Object javaArray) {
+ int length = Array.getLength(javaArray);
+ JsonArray array = Json.createArray();
+ for (int i = 0; i < length; i++) {
+ array.set(i, toJson(Array.get(javaArray, i)));
}
+ return array;
+ }
- /**
- * Converts a collection of object into a {@link JsonArray}, converting each
- * item of the collection individually.
- *
- * @param beans
- * the collection of objects to be converted
- * @return the json representation of the objects in the collectios. An
- * empty array is returned if the input collections is
- * null
- */
- public static JsonArray toJson(Collection> beans) {
- JsonArray array = Json.createArray();
- if (beans == null) {
- return array;
- }
+ private static Optional tryToConvertToSimpleType(Object bean) {
+ if (bean instanceof String) {
+ return Optional.of(Json.create((String) bean));
+ }
+ if (bean instanceof Number) {
+ return Optional.of(Json.create(((Number) bean).doubleValue()));
+ }
+ if (bean instanceof Boolean) {
+ return Optional.of(Json.create((Boolean) bean));
+ }
+ if (bean instanceof Character) {
+ return Optional.of(Json.create(Character.toString((char) bean)));
+ }
+ if (bean instanceof Enum) {
+ return Optional.of(Json.create(((Enum>) bean).name()));
+ }
+ if (bean instanceof JsonValue) {
+ return Optional.of((JsonValue) bean);
+ }
+ return Optional.empty();
+ }
+
+ /**
+ * Converts a JsonValue to the corresponding Java object. The Java object can be a Java bean,
+ * String, wrapper of primitive types or an enum.
+ *
+ * @param type the type of the Java object convert the json to
+ * @param json the json representation of the object
+ * @param the resulting object type
+ * @return the deserialized object, or null if the input json is null
+ */
+ public static T toObject(Class type, JsonValue json) {
+ return toObject(type, null, json);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static T toObject(Class type, Type genericType, JsonValue json) {
+ if (json == null || json instanceof JsonNull) {
+ return null;
+ }
- beans.stream().map(JsonSerializer::toJson)
- .forEachOrdered(json -> array.set(array.length(), json));
- return array;
+ Optional> simpleType = tryToConvertFromSimpleType(type, json);
+ if (simpleType.isPresent()) {
+ return (T) simpleType.get();
}
- private static JsonArray toJsonArray(Object javaArray) {
- int length = Array.getLength(javaArray);
- JsonArray array = Json.createArray();
- for (int i = 0; i < length; i++) {
- array.set(i, toJson(Array.get(javaArray, i)));
- }
- return array;
+ if (Collection.class.isAssignableFrom(type)) {
+ return toCollection(type, genericType, json);
}
- private static Optional tryToConvertToSimpleType(Object bean) {
- if (bean instanceof String) {
- return Optional.of(Json.create((String) bean));
- }
- if (bean instanceof Number) {
- return Optional.of(Json.create(((Number) bean).doubleValue()));
- }
- if (bean instanceof Boolean) {
- return Optional.of(Json.create((Boolean) bean));
- }
- if (bean instanceof Character) {
- return Optional.of(Json.create(Character.toString((char) bean)));
- }
- if (bean instanceof Enum) {
- return Optional.of(Json.create(((Enum>) bean).name()));
- }
- if (bean instanceof JsonValue) {
- return Optional.of((JsonValue) bean);
- }
- return Optional.empty();
- }
-
- /**
- * Converts a JsonValue to the corresponding Java object. The Java object can be a Java bean,
- * String, wrapper of primitive types or an enum.
- *
- * @param type the type of the Java object convert the json to
- * @param json the json representation of the object
- * @param the resulting object type
- *
- * @return the deserialized object, or null if the input json is null
- */
- public static T toObject(Class type, JsonValue json) {
- return toObject(type, null, json);
- }
-
- @SuppressWarnings("unchecked")
- private static T toObject(Class type, Type genericType,
- JsonValue json) {
- if (json == null || json instanceof JsonNull) {
- return null;
- }
+ if (type.isRecord()) {
+ return toRecord(type, json);
+ }
- Optional> simpleType = tryToConvertFromSimpleType(type, json);
- if (simpleType.isPresent()) {
- return (T) simpleType.get();
- }
+ T instance;
+ try {
+ instance = type.newInstance();
+ } catch (Exception e) {
+ throw new IllegalArgumentException(
+ "Could not create an instance of type "
+ + type
+ + ". Make sure it contains a default public constructor and the class is accessible.",
+ e);
+ }
- if (Collection.class.isAssignableFrom(type)) {
- return toCollection(type, genericType, json);
- }
+ try {
- if (type.isRecord()) {
- return toRecord(type, json);
- }
+ JsonObject jsonObject = (JsonObject) json;
+ String[] keys = jsonObject.keys();
+ if (keys == null) {
+ return instance;
+ }
- T instance;
- try {
- instance = type.newInstance();
- } catch (Exception e) {
- throw new IllegalArgumentException(
- "Could not create an instance of type " + type
- + ". Make sure it contains a default public constructor and the class is accessible.",
- e);
- }
+ BeanInfo info = Introspector.getBeanInfo(type);
+ Map writers = new HashMap<>();
- try {
-
- JsonObject jsonObject = (JsonObject) json;
- String[] keys = jsonObject.keys();
- if (keys == null) {
- return instance;
- }
-
- BeanInfo info = Introspector.getBeanInfo(type);
- Map writers = new HashMap<>();
-
- for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
- Method writer = pd.getWriteMethod();
- if (writer != null) {
- writers.put(pd.getName(), writer);
- }
- }
- for (String key : keys) {
- JsonValue jsonValue = jsonObject.get(key);
-
- Method method = writers.get(key);
- if (method != null) {
- Class> parameterType = method.getParameterTypes()[0];
- Type genericParameterType = method
- .getGenericParameterTypes()[0];
- Object value = toObject(parameterType, genericParameterType,
- jsonValue);
- method.invoke(instance, value);
- }
- }
-
- return instance;
- } catch (Exception e) {
- throw new IllegalArgumentException(
- "Could not deserialize object of type " + type
- + " from JsonValue",
- e);
+ for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
+ Method writer = pd.getWriteMethod();
+ if (writer != null) {
+ writers.put(pd.getName(), writer);
}
- }
+ }
+ for (String key : keys) {
+ JsonValue jsonValue = jsonObject.get(key);
- private static T toRecord(Class type, JsonValue json) {
- try {
- RecordComponent[] components = type.getRecordComponents();
- Class>[] componentTypes = new Class>[components.length];
- Object[] values = new Object[components.length];
-
- for (int i = 0; i < components.length; i++) {
- componentTypes[i] = components[i].getType();
- values[i] = toObject(componentTypes[i],
- ((JsonObject) json).get(components[i].getName()));
- }
-
- return type.getDeclaredConstructor(componentTypes)
- .newInstance(values);
- } catch (Exception e) {
- throw new IllegalArgumentException(
- "Could not deserialize record of type " + type
- + " from JsonValue",
- e);
+ Method method = writers.get(key);
+ if (method != null) {
+ Class> parameterType = method.getParameterTypes()[0];
+ Type genericParameterType = method.getGenericParameterTypes()[0];
+ Object value = toObject(parameterType, genericParameterType, jsonValue);
+ method.invoke(instance, value);
}
- }
+ }
- private static T toCollection(Class type, Type genericType,
- JsonValue json) {
- if (json.getType() != JsonType.ARRAY) {
- return null;
- }
- if (!(genericType instanceof ParameterizedType)) {
- throw new IllegalArgumentException(
- "Could not infer the generic parameterized type of the collection of class: "
- + type.getName()
- + ". The type is no subclass of ParameterizedType: "
- + genericType);
- }
- JsonArray array = (JsonArray) json;
- Collection> collection = tryToCreateCollection(type, array.length());
- if (array.length() > 0) {
- ParameterizedType parameterizedType = (ParameterizedType) genericType;
- Class> parameterizedClass = (Class>) parameterizedType
- .getActualTypeArguments()[0];
- collection.addAll(
- (List) toObjects(parameterizedClass, (JsonArray) json));
- }
- return (T) collection;
- }
-
- /**
- * Converts a JsonArray into a collection of Java objects. The Java objects can be Java beans,
- * Strings, wrappers of primitive types or enums.
- *
- * @param type the type of the elements in the array
- * @param json the json representation of the objects
- * @param the resulting objects types
- *
- * @return a modifiable list of converted objects. Returns an empty list if the input array is
- * null
- */
- public static List toObjects(Class type, JsonArray json) {
- if (json == null) {
- return new ArrayList<>(0);
- }
- List list = new ArrayList<>(json.length());
- for (int i = 0; i < json.length(); i++) {
- list.add(JsonSerializer.toObject(type, json.get(i)));
- }
- return list;
+ return instance;
+ } catch (Exception e) {
+ throw new IllegalArgumentException(
+ "Could not deserialize object of type " + type + " from JsonValue", e);
}
+ }
+
+ private static T toRecord(Class type, JsonValue json) {
+ try {
+ RecordComponent[] components = type.getRecordComponents();
+ Class>[] componentTypes = new Class>[components.length];
+ Object[] values = new Object[components.length];
+
+ for (int i = 0; i < components.length; i++) {
+ componentTypes[i] = components[i].getType();
+ values[i] = toObject(componentTypes[i], ((JsonObject) json).get(components[i].getName()));
+ }
+
+ return type.getDeclaredConstructor(componentTypes).newInstance(values);
+ } catch (Exception e) {
+ throw new IllegalArgumentException(
+ "Could not deserialize record of type " + type + " from JsonValue", e);
+ }
+ }
- private static Optional> tryToConvertFromSimpleType(Class> type,
- JsonValue json) {
- if (type.isAssignableFrom(String.class)) {
- return Optional.of(json.asString());
- }
- if (type.isAssignableFrom(int.class)
- || type.isAssignableFrom(Integer.class)) {
- return Optional.of((int) json.asNumber());
- }
- if (type.isAssignableFrom(double.class)
- || type.isAssignableFrom(Double.class)) {
- return Optional.of(json.asNumber());
- }
- if (type.isAssignableFrom(long.class)
- || type.isAssignableFrom(Long.class)) {
- return Optional.of((long) json.asNumber());
- }
- if (type.isAssignableFrom(short.class)
- || type.isAssignableFrom(Short.class)) {
- return Optional.of((short) json.asNumber());
- }
- if (type.isAssignableFrom(byte.class)
- || type.isAssignableFrom(Byte.class)) {
- return Optional.of((byte) json.asNumber());
- }
- if (type.isAssignableFrom(char.class)
- || type.isAssignableFrom(Character.class)) {
- return Optional.of(json.asString().charAt(0));
- }
- if (type.isAssignableFrom(Boolean.class)
- || type.isAssignableFrom(boolean.class)) {
- return Optional.of(json.asBoolean());
- }
- if (type.isEnum()) {
- return Optional.of(Enum.valueOf((Class extends Enum>) type,
- json.asString()));
- }
- if (JsonValue.class.isAssignableFrom(type)) {
- return Optional.of(json);
- }
- return Optional.empty();
-
- }
-
- private static Collection> tryToCreateCollection(Class> collectionType,
- int initialCapacity) {
- if (collectionType.isInterface()) {
- if (List.class.isAssignableFrom(collectionType)) {
- return new ArrayList<>(initialCapacity);
- }
- if (Set.class.isAssignableFrom(collectionType)) {
- return new LinkedHashSet<>(initialCapacity);
- }
- throw new IllegalArgumentException(
- "Collection type not supported: '"
- + collectionType.getName()
- + "'. Use Lists, Sets or concrete classes that implement java.util.Collection.");
- }
- try {
- return (Collection>) collectionType.newInstance();
- } catch (Exception e) {
- throw new IllegalArgumentException(
- "Could not create an instance of the collection of type "
- + collectionType
- + ". Make sure it contains a default public constructor and the class is accessible.",
- e);
- }
+ private static T toCollection(Class type, Type genericType, JsonValue json) {
+ if (json.getType() != JsonType.ARRAY) {
+ return null;
+ }
+ if (!(genericType instanceof ParameterizedType)) {
+ throw new IllegalArgumentException(
+ "Could not infer the generic parameterized type of the collection of class: "
+ + type.getName()
+ + ". The type is no subclass of ParameterizedType: "
+ + genericType);
+ }
+ JsonArray array = (JsonArray) json;
+ Collection> collection = tryToCreateCollection(type, array.length());
+ if (array.length() > 0) {
+ ParameterizedType parameterizedType = (ParameterizedType) genericType;
+ Class> parameterizedClass = (Class>) parameterizedType.getActualTypeArguments()[0];
+ collection.addAll((List) toObjects(parameterizedClass, (JsonArray) json));
+ }
+ return (T) collection;
+ }
+
+ /**
+ * Converts a JsonArray into a collection of Java objects. The Java objects can be Java beans,
+ * Strings, wrappers of primitive types or enums.
+ *
+ * @param type the type of the elements in the array
+ * @param json the json representation of the objects
+ * @param the resulting objects types
+ * @return a modifiable list of converted objects. Returns an empty list if the input array is
+ * null
+ */
+ public static List toObjects(Class type, JsonArray json) {
+ if (json == null) {
+ return new ArrayList<>(0);
+ }
+ List list = new ArrayList<>(json.length());
+ for (int i = 0; i < json.length(); i++) {
+ list.add(JsonSerializer.toObject(type, json.get(i)));
}
+ return list;
+ }
+ private static Optional> tryToConvertFromSimpleType(Class> type, JsonValue json) {
+ if (type.isAssignableFrom(String.class)) {
+ return Optional.of(json.asString());
+ }
+ if (type.isAssignableFrom(int.class) || type.isAssignableFrom(Integer.class)) {
+ return Optional.of((int) json.asNumber());
+ }
+ if (type.isAssignableFrom(double.class) || type.isAssignableFrom(Double.class)) {
+ return Optional.of(json.asNumber());
+ }
+ if (type.isAssignableFrom(long.class) || type.isAssignableFrom(Long.class)) {
+ return Optional.of((long) json.asNumber());
+ }
+ if (type.isAssignableFrom(short.class) || type.isAssignableFrom(Short.class)) {
+ return Optional.of((short) json.asNumber());
+ }
+ if (type.isAssignableFrom(byte.class) || type.isAssignableFrom(Byte.class)) {
+ return Optional.of((byte) json.asNumber());
+ }
+ if (type.isAssignableFrom(char.class) || type.isAssignableFrom(Character.class)) {
+ return Optional.of(json.asString().charAt(0));
+ }
+ if (type.isAssignableFrom(Boolean.class) || type.isAssignableFrom(boolean.class)) {
+ return Optional.of(json.asBoolean());
+ }
+ if (type.isEnum()) {
+ return Optional.of(Enum.valueOf((Class extends Enum>) type, json.asString()));
+ }
+ if (JsonValue.class.isAssignableFrom(type)) {
+ return Optional.of(json);
+ }
+ return Optional.empty();
+ }
+
+ private static Collection> tryToCreateCollection(Class> collectionType, int initialCapacity) {
+ if (collectionType.isInterface()) {
+ if (List.class.isAssignableFrom(collectionType)) {
+ return new ArrayList<>(initialCapacity);
+ }
+ if (Set.class.isAssignableFrom(collectionType)) {
+ return new LinkedHashSet<>(initialCapacity);
+ }
+ throw new IllegalArgumentException(
+ "Collection type not supported: '"
+ + collectionType.getName()
+ + "'. Use Lists, Sets or concrete classes that implement java.util.Collection.");
+ }
+ try {
+ return (Collection>) collectionType.newInstance();
+ } catch (Exception e) {
+ throw new IllegalArgumentException(
+ "Could not create an instance of the collection of type "
+ + collectionType
+ + ". Make sure it contains a default public constructor and the class is accessible.",
+ e);
+ }
+ }
}
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable.java
index 1842928..53f3dc7 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,12 +26,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-/**
- * When instrumented, publishes the annotated method as if {@link ClientCallable} has been used.
- */
+/** When instrumented, publishes the annotated method as if {@link ClientCallable} has been used. */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Documented
-public @interface LegacyClientCallable {
-
-}
+public @interface LegacyClientCallable {}
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/LegacyJsonMigrationHelper.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/LegacyJsonMigrationHelper.java
index bc748f5..890a493 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/LegacyJsonMigrationHelper.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/LegacyJsonMigrationHelper.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,8 +21,8 @@
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.page.PendingJavaScriptResult;
-import java.lang.reflect.Method;
import elemental.json.JsonValue;
+import java.lang.reflect.Method;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.SneakyThrows;
@@ -47,7 +47,7 @@ public JsonValue convertToJsonValue(Object object) {
object.getClass().getName() + " cannot be converted to elemental.json.JsonObject");
}
}
-
+
@Override
public T convertToClientCallableResult(T object) {
return object;
@@ -69,8 +69,6 @@ public ElementalPendingJavaScriptResult convertPendingJavaScriptResult(
@AllArgsConstructor
private static final class PendingJavaScriptResultImpl
implements ElementalPendingJavaScriptResult, PendingJavaScriptResult {
- @Delegate
- private final PendingJavaScriptResult delegate;
+ @Delegate private final PendingJavaScriptResult delegate;
}
-
}
diff --git a/src/main/java/com/flowingcode/vaadin/jsonmigration/UnsupportedJsonValueImpl.java b/src/main/java/com/flowingcode/vaadin/jsonmigration/UnsupportedJsonValueImpl.java
index 15d477c..9b81252 100644
--- a/src/main/java/com/flowingcode/vaadin/jsonmigration/UnsupportedJsonValueImpl.java
+++ b/src/main/java/com/flowingcode/vaadin/jsonmigration/UnsupportedJsonValueImpl.java
@@ -53,5 +53,4 @@ default boolean jsEquals(JsonValue value) {
default Object toNative() {
throw new UnsupportedOperationException();
}
-
-}
\ No newline at end of file
+}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/BaseClientCallable.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/BaseClientCallable.java
index a18d1e3..8be3e06 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/BaseClientCallable.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/BaseClientCallable.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import com.vaadin.flow.component.html.Div;
@@ -13,5 +32,4 @@ protected final void trace() {
public boolean hasBeenTraced() {
return traced;
}
-
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_D__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_D__V.java
index 200300c..8546198 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_D__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_D__V.java
@@ -1,14 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
public class ClientCallable_D__V extends BaseClientCallable {
- @ClientCallable
- public void test(double arg) {
- trace();
- }
+ @ClientCallable
+ public void test(double arg) {
+ trace();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_I__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_I__V.java
index e1c6b64..e8a1f9a 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_I__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_I__V.java
@@ -1,14 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
public class ClientCallable_I__V extends BaseClientCallable {
- @ClientCallable
- public void test(int arg) {
- trace();
- }
+ @ClientCallable
+ public void test(int arg) {
+ trace();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonArray__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonArray__V.java
index e0a8e4b..abfb4a1 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonArray__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonArray__V.java
@@ -1,16 +1,31 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.JsonArray;
public class ClientCallable_JsonArray__V extends BaseClientCallable {
- @ClientCallable
- public void test(JsonArray arg) {
- trace();
- }
+ @ClientCallable
+ public void test(JsonArray arg) {
+ trace();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonBoolean__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonBoolean__V.java
index 5827387..9e4cb39 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonBoolean__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonBoolean__V.java
@@ -1,8 +1,25 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.JsonBoolean;
public class ClientCallable_JsonBoolean__V extends BaseClientCallable {
@@ -12,5 +29,3 @@ public void test(JsonBoolean arg) {
trace();
}
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonNull__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonNull__V.java
index 76c8e83..c1d8678 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonNull__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonNull__V.java
@@ -1,16 +1,31 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.JsonNull;
public class ClientCallable_JsonNull__V extends BaseClientCallable {
- @ClientCallable
- public void test(JsonNull arg) {
- trace();
- }
+ @ClientCallable
+ public void test(JsonNull arg) {
+ trace();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonNumber__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonNumber__V.java
index aed624e..e248074 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonNumber__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonNumber__V.java
@@ -1,16 +1,31 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.JsonNumber;
public class ClientCallable_JsonNumber__V extends BaseClientCallable {
- @ClientCallable
- public void test(JsonNumber arg) {
- trace();
- }
+ @ClientCallable
+ public void test(JsonNumber arg) {
+ trace();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonObject__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonObject__V.java
index bf57234..a5ad6fd 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonObject__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonObject__V.java
@@ -1,16 +1,31 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.JsonObject;
public class ClientCallable_JsonObject__V extends BaseClientCallable {
- @ClientCallable
- public void test(JsonObject arg) {
- trace();
- }
+ @ClientCallable
+ public void test(JsonObject arg) {
+ trace();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonString__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonString__V.java
index 8ec0a0c..89c1779 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonString__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonString__V.java
@@ -1,16 +1,31 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.JsonString;
public class ClientCallable_JsonString__V extends BaseClientCallable {
- @ClientCallable
- public void test(JsonString arg) {
- trace();
- }
+ @ClientCallable
+ public void test(JsonString arg) {
+ trace();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonValue__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonValue__V.java
index d67944d..4f15f86 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonValue__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_JsonValue__V.java
@@ -1,16 +1,31 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.JsonValue;
public class ClientCallable_JsonValue__V extends BaseClientCallable {
- @ClientCallable
- public void test(JsonValue arg) {
- trace();
- }
+ @ClientCallable
+ public void test(JsonValue arg) {
+ trace();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_String__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_String__V.java
index b287f3a..df2132c 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_String__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_String__V.java
@@ -1,14 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
public class ClientCallable_String__V extends BaseClientCallable {
- @ClientCallable
- public void test(String arg) {
- trace();
- }
+ @ClientCallable
+ public void test(String arg) {
+ trace();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_Z__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_Z__V.java
index ed40c9e..ae824fd 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_Z__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable_Z__V.java
@@ -1,14 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
public class ClientCallable_Z__V extends BaseClientCallable {
- @ClientCallable
- public void test(boolean arg) {
- trace();
- }
+ @ClientCallable
+ public void test(boolean arg) {
+ trace();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__D.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__D.java
index 4849317..e4074a8 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__D.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__D.java
@@ -1,15 +1,31 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
public class ClientCallable__D extends BaseClientCallable {
- @ClientCallable
- public double test() {
- trace();
- return 0.0;
- }
+ @ClientCallable
+ public double test() {
+ trace();
+ return 0.0;
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__I.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__I.java
index f6285ed..f6e0757 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__I.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__I.java
@@ -1,15 +1,31 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
public class ClientCallable__I extends BaseClientCallable {
- @ClientCallable
- public int test() {
- trace();
- return 0;
- }
+ @ClientCallable
+ public int test() {
+ trace();
+ return 0;
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__Integer.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__Integer.java
index cc45c7b..0f60bb1 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__Integer.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__Integer.java
@@ -1,15 +1,31 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
public class ClientCallable__Integer extends BaseClientCallable {
- @ClientCallable
- public Integer test() {
- trace();
- return 0;
- }
+ @ClientCallable
+ public Integer test() {
+ trace();
+ return 0;
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonArray.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonArray.java
index d44c3fa..189dc59 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonArray.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonArray.java
@@ -1,18 +1,33 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.Json;
import elemental.json.JsonArray;
public class ClientCallable__JsonArray extends BaseClientCallable {
- @ClientCallable
- public JsonArray test() {
- trace();
- return Json.createArray();
- }
+ @ClientCallable
+ public JsonArray test() {
+ trace();
+ return Json.createArray();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonBoolean.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonBoolean.java
index 75dd3a0..fbfbbb5 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonBoolean.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonBoolean.java
@@ -1,18 +1,33 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.Json;
import elemental.json.JsonBoolean;
public class ClientCallable__JsonBoolean extends BaseClientCallable {
- @ClientCallable
- public JsonBoolean test() {
- trace();
- return Json.create(true);
- }
+ @ClientCallable
+ public JsonBoolean test() {
+ trace();
+ return Json.create(true);
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonNull.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonNull.java
index 7c80c5b..131f452 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonNull.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonNull.java
@@ -1,18 +1,33 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.Json;
import elemental.json.JsonNull;
public class ClientCallable__JsonNull extends BaseClientCallable {
- @ClientCallable
- public JsonNull test() {
- trace();
- return Json.createNull();
- }
+ @ClientCallable
+ public JsonNull test() {
+ trace();
+ return Json.createNull();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonNumber.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonNumber.java
index 5771266..b5e0af6 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonNumber.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonNumber.java
@@ -1,18 +1,33 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.Json;
import elemental.json.JsonNumber;
public class ClientCallable__JsonNumber extends BaseClientCallable {
- @ClientCallable
- public JsonNumber test() {
- trace();
- return Json.create(0);
- }
+ @ClientCallable
+ public JsonNumber test() {
+ trace();
+ return Json.create(0);
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonObject.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonObject.java
index 4c46549..c576c67 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonObject.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonObject.java
@@ -1,18 +1,33 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.Json;
import elemental.json.JsonObject;
public class ClientCallable__JsonObject extends BaseClientCallable {
- @ClientCallable
- public JsonObject test() {
- trace();
- return Json.createObject();
- }
+ @ClientCallable
+ public JsonObject test() {
+ trace();
+ return Json.createObject();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonString.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonString.java
index 286999d..9ed671a 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonString.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonString.java
@@ -1,18 +1,33 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.Json;
import elemental.json.JsonString;
public class ClientCallable__JsonString extends BaseClientCallable {
- @ClientCallable
- public JsonString test() {
- trace();
- return Json.create("");
- }
+ @ClientCallable
+ public JsonString test() {
+ trace();
+ return Json.create("");
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonValue.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonValue.java
index 67ec848..22de4e2 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonValue.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__JsonValue.java
@@ -1,18 +1,33 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
-
import elemental.json.Json;
import elemental.json.JsonValue;
public class ClientCallable__JsonValue extends BaseClientCallable {
- @ClientCallable
- public JsonValue test() {
- trace();
- return Json.createObject();
- }
+ @ClientCallable
+ public JsonValue test() {
+ trace();
+ return Json.createObject();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__V.java
index dd86972..ec3ec5f 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__V.java
@@ -1,14 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
public class ClientCallable__V extends BaseClientCallable {
- @ClientCallable
- public void test() {
- trace();
- }
+ @ClientCallable
+ public void test() {
+ trace();
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__Z.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__Z.java
index f71235d..5c6cd44 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__Z.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallable__Z.java
@@ -1,15 +1,31 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import com.vaadin.flow.component.ClientCallable;
public class ClientCallable__Z extends BaseClientCallable {
- @ClientCallable
- public boolean test() {
- trace();
- return true;
- }
+ @ClientCallable
+ public boolean test() {
+ trace();
+ return true;
+ }
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest.java
index a8196e5..db1884d 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest.java
@@ -1,7 +1,27 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+
import com.vaadin.flow.component.ClientCallable;
import com.vaadin.flow.component.Component;
import elemental.json.JsonValue;
@@ -34,7 +54,7 @@ protected static Method getClientCallableTestMethod(Class extends Component> c
* Invokes the test method on the instrumented instance via reflection.
*
* @param instrumented the instrumented instance
- * @param args the arguments to pass to the test method
+ * @param args the arguments to pass to the test method
* @return the result of the method invocation
* @throws Exception if invocation fails
*/
@@ -59,48 +79,48 @@ private Object invokeTestMethod(BaseClientCallable instrumented, Object... args)
@Test
public void test__V() throws Exception {
- ClientCallable__V instrumented = instrumentClass(ClientCallable__V.class).getDeclaredConstructor()
- .newInstance();
+ ClientCallable__V instrumented =
+ instrumentClass(ClientCallable__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_Z__V() throws Exception {
- ClientCallable_Z__V instrumented = instrumentClass(ClientCallable_Z__V.class).getDeclaredConstructor()
- .newInstance();
+ ClientCallable_Z__V instrumented =
+ instrumentClass(ClientCallable_Z__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, true);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_I__V() throws Exception {
- ClientCallable_I__V instrumented = instrumentClass(ClientCallable_I__V.class).getDeclaredConstructor()
- .newInstance();
+ ClientCallable_I__V instrumented =
+ instrumentClass(ClientCallable_I__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, 42);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_D__V() throws Exception {
- ClientCallable_D__V instrumented = instrumentClass(ClientCallable_D__V.class).getDeclaredConstructor()
- .newInstance();
+ ClientCallable_D__V instrumented =
+ instrumentClass(ClientCallable_D__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, 3.14);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_String__V() throws Exception {
- ClientCallable_String__V instrumented = instrumentClass(ClientCallable_String__V.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable_String__V instrumented =
+ instrumentClass(ClientCallable_String__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, "test");
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test__Z() throws Exception {
- ClientCallable__Z instrumented = instrumentClass(ClientCallable__Z.class).getDeclaredConstructor()
- .newInstance();
+ ClientCallable__Z instrumented =
+ instrumentClass(ClientCallable__Z.class).getDeclaredConstructor().newInstance();
ClientCallable__Z nonInstrumented = new ClientCallable__Z();
boolean result = (boolean) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -109,8 +129,8 @@ public void test__Z() throws Exception {
@Test
public void test__I() throws Exception {
- ClientCallable__I instrumented = instrumentClass(ClientCallable__I.class).getDeclaredConstructor()
- .newInstance();
+ ClientCallable__I instrumented =
+ instrumentClass(ClientCallable__I.class).getDeclaredConstructor().newInstance();
ClientCallable__I nonInstrumented = new ClientCallable__I();
int result = (int) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -119,8 +139,8 @@ public void test__I() throws Exception {
@Test
public void test__D() throws Exception {
- ClientCallable__D instrumented = instrumentClass(ClientCallable__D.class).getDeclaredConstructor()
- .newInstance();
+ ClientCallable__D instrumented =
+ instrumentClass(ClientCallable__D.class).getDeclaredConstructor().newInstance();
ClientCallable__D nonInstrumented = new ClientCallable__D();
double result = (double) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -129,8 +149,8 @@ public void test__D() throws Exception {
@Test
public void test__Integer() throws Exception {
- ClientCallable__Integer instrumented = instrumentClass(ClientCallable__Integer.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable__Integer instrumented =
+ instrumentClass(ClientCallable__Integer.class).getDeclaredConstructor().newInstance();
ClientCallable__Integer nonInstrumented = new ClientCallable__Integer();
Integer result = (Integer) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -139,8 +159,8 @@ public void test__Integer() throws Exception {
@Test
public void test__JsonValue() throws Exception {
- ClientCallable__JsonValue instrumented = instrumentClass(ClientCallable__JsonValue.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable__JsonValue instrumented =
+ instrumentClass(ClientCallable__JsonValue.class).getDeclaredConstructor().newInstance();
ClientCallable__JsonValue nonInstrumented = new ClientCallable__JsonValue();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -149,8 +169,8 @@ public void test__JsonValue() throws Exception {
@Test
public void test__JsonBoolean() throws Exception {
- ClientCallable__JsonBoolean instrumented = instrumentClass(ClientCallable__JsonBoolean.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable__JsonBoolean instrumented =
+ instrumentClass(ClientCallable__JsonBoolean.class).getDeclaredConstructor().newInstance();
ClientCallable__JsonBoolean nonInstrumented = new ClientCallable__JsonBoolean();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -159,8 +179,8 @@ public void test__JsonBoolean() throws Exception {
@Test
public void test__JsonNumber() throws Exception {
- ClientCallable__JsonNumber instrumented = instrumentClass(ClientCallable__JsonNumber.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable__JsonNumber instrumented =
+ instrumentClass(ClientCallable__JsonNumber.class).getDeclaredConstructor().newInstance();
ClientCallable__JsonNumber nonInstrumented = new ClientCallable__JsonNumber();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -169,8 +189,8 @@ public void test__JsonNumber() throws Exception {
@Test
public void test__JsonString() throws Exception {
- ClientCallable__JsonString instrumented = instrumentClass(ClientCallable__JsonString.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable__JsonString instrumented =
+ instrumentClass(ClientCallable__JsonString.class).getDeclaredConstructor().newInstance();
ClientCallable__JsonString nonInstrumented = new ClientCallable__JsonString();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -179,8 +199,8 @@ public void test__JsonString() throws Exception {
@Test
public void test__JsonNull() throws Exception {
- ClientCallable__JsonNull instrumented = instrumentClass(ClientCallable__JsonNull.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable__JsonNull instrumented =
+ instrumentClass(ClientCallable__JsonNull.class).getDeclaredConstructor().newInstance();
ClientCallable__JsonNull nonInstrumented = new ClientCallable__JsonNull();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -189,8 +209,8 @@ public void test__JsonNull() throws Exception {
@Test
public void test__JsonArray() throws Exception {
- ClientCallable__JsonArray instrumented = instrumentClass(ClientCallable__JsonArray.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable__JsonArray instrumented =
+ instrumentClass(ClientCallable__JsonArray.class).getDeclaredConstructor().newInstance();
ClientCallable__JsonArray nonInstrumented = new ClientCallable__JsonArray();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -199,8 +219,8 @@ public void test__JsonArray() throws Exception {
@Test
public void test__JsonObject() throws Exception {
- ClientCallable__JsonObject instrumented = instrumentClass(ClientCallable__JsonObject.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable__JsonObject instrumented =
+ instrumentClass(ClientCallable__JsonObject.class).getDeclaredConstructor().newInstance();
ClientCallable__JsonObject nonInstrumented = new ClientCallable__JsonObject();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -209,58 +229,57 @@ public void test__JsonObject() throws Exception {
@Test
public void test_JsonValue__V() throws Exception {
- ClientCallable_JsonValue__V instrumented = instrumentClass(ClientCallable_JsonValue__V.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable_JsonValue__V instrumented =
+ instrumentClass(ClientCallable_JsonValue__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, createJsonNull());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonBoolean__V() throws Exception {
- ClientCallable_JsonBoolean__V instrumented = instrumentClass(ClientCallable_JsonBoolean__V.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable_JsonBoolean__V instrumented =
+ instrumentClass(ClientCallable_JsonBoolean__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, createJsonBoolean());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonNumber__V() throws Exception {
- ClientCallable_JsonNumber__V instrumented = instrumentClass(ClientCallable_JsonNumber__V.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable_JsonNumber__V instrumented =
+ instrumentClass(ClientCallable_JsonNumber__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, createJsonNumber());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonString__V() throws Exception {
- ClientCallable_JsonString__V instrumented = instrumentClass(ClientCallable_JsonString__V.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable_JsonString__V instrumented =
+ instrumentClass(ClientCallable_JsonString__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, createJsonString());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonNull__V() throws Exception {
- ClientCallable_JsonNull__V instrumented = instrumentClass(ClientCallable_JsonNull__V.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable_JsonNull__V instrumented =
+ instrumentClass(ClientCallable_JsonNull__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, createJsonNull());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonArray__V() throws Exception {
- ClientCallable_JsonArray__V instrumented = instrumentClass(ClientCallable_JsonArray__V.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable_JsonArray__V instrumented =
+ instrumentClass(ClientCallable_JsonArray__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, createJsonArray());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonObject__V() throws Exception {
- ClientCallable_JsonObject__V instrumented = instrumentClass(ClientCallable_JsonObject__V.class)
- .getDeclaredConstructor().newInstance();
+ ClientCallable_JsonObject__V instrumented =
+ instrumentClass(ClientCallable_JsonObject__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, createJsonObject());
assertTrue(instrumented.hasBeenTraced());
}
-
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest24.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest24.java
index 221a653..881e695 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest24.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest24.java
@@ -1,8 +1,27 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertEquals;
+
import com.vaadin.flow.component.Component;
import elemental.json.Json;
import elemental.json.JsonValue;
@@ -13,8 +32,7 @@ public class ClientCallablesTest24 extends ClientCallablesTest {
private static final String ERRMSG = "must be annotated with @LegacyClientCallable";
- @Rule
- public ExpectedException thrown = ExpectedException.none();
+ @Rule public ExpectedException thrown = ExpectedException.none();
@Override
protected Class extends T> instrumentClass(Class clazz) {
@@ -59,8 +77,4 @@ protected Object createJsonArray() {
protected Object createJsonObject() {
return Json.createObject();
}
-
-
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest25.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest25.java
index 6ba2708..29d3814 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest25.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ClientCallablesTest25.java
@@ -1,7 +1,26 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-
import static org.hamcrest.Matchers.containsString;
+
import com.vaadin.flow.component.Component;
import elemental.json.JsonValue;
import org.junit.Rule;
@@ -18,8 +37,7 @@ public class ClientCallablesTest25 extends ClientCallablesTest {
private static final String ERRMSG = "must be annotated with @LegacyClientCallable";
- @Rule
- public ExpectedException thrown = ExpectedException.none();
+ @Rule public ExpectedException thrown = ExpectedException.none();
@Override
protected Class extends T> instrumentClass(Class clazz) {
@@ -62,7 +80,4 @@ protected Object createJsonArray() {
protected Object createJsonObject() {
return new ObjectNode(JsonNodeFactory.instance);
}
-
}
-
-
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/ExtendsLegacyClientCallablePrivate__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/ExtendsLegacyClientCallablePrivate__V.java
index 6400df3..0725e48 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/ExtendsLegacyClientCallablePrivate__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/ExtendsLegacyClientCallablePrivate__V.java
@@ -1,5 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
-public class ExtendsLegacyClientCallablePrivate__V extends LegacyClientCallablePrivate__V {
-
-}
+public class ExtendsLegacyClientCallablePrivate__V extends LegacyClientCallablePrivate__V {}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_D__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_D__V.java
index f44f452..c7a7f0c 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_D__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_D__V.java
@@ -1,9 +1,28 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallablePrivate_D__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test(double arg) {
- trace();
- }
+ @LegacyClientCallable
+ private void test(double arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_I__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_I__V.java
index 896e3b0..5f36fce 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_I__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_I__V.java
@@ -1,9 +1,28 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallablePrivate_I__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test(int arg) {
- trace();
- }
+ @LegacyClientCallable
+ private void test(int arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonArray__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonArray__V.java
index 2fa0868..6a79d6d 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonArray__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonArray__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonArray;
public class LegacyClientCallablePrivate_JsonArray__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test(JsonArray arg) {
- trace();
- }
+ @LegacyClientCallable
+ private void test(JsonArray arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonBoolean__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonBoolean__V.java
index 25a9b50..a0020ec 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonBoolean__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonBoolean__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonBoolean;
public class LegacyClientCallablePrivate_JsonBoolean__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test(JsonBoolean arg) {
- trace();
- }
+ @LegacyClientCallable
+ private void test(JsonBoolean arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonNull__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonNull__V.java
index aa9fbfe..94d20d6 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonNull__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonNull__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonNull;
public class LegacyClientCallablePrivate_JsonNull__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test(JsonNull arg) {
- trace();
- }
+ @LegacyClientCallable
+ private void test(JsonNull arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonNumber__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonNumber__V.java
index 72c559e..6b05253 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonNumber__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonNumber__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonNumber;
public class LegacyClientCallablePrivate_JsonNumber__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test(JsonNumber arg) {
- trace();
- }
+ @LegacyClientCallable
+ private void test(JsonNumber arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonObject__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonObject__V.java
index 88e4e65..5095d63 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonObject__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonObject__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonObject;
public class LegacyClientCallablePrivate_JsonObject__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test(JsonObject arg) {
- trace();
- }
+ @LegacyClientCallable
+ private void test(JsonObject arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonString__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonString__V.java
index cc59dfc..5c8e7fc 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonString__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonString__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonString;
public class LegacyClientCallablePrivate_JsonString__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test(JsonString arg) {
- trace();
- }
+ @LegacyClientCallable
+ private void test(JsonString arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonValue__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonValue__V.java
index 72d8a34..618ca03 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonValue__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_JsonValue__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonValue;
public class LegacyClientCallablePrivate_JsonValue__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test(JsonValue arg) {
- trace();
- }
+ @LegacyClientCallable
+ private void test(JsonValue arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_String__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_String__V.java
index 91af544..815c706 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_String__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_String__V.java
@@ -1,9 +1,28 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallablePrivate_String__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test(String arg) {
- trace();
- }
+ @LegacyClientCallable
+ private void test(String arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_Z__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_Z__V.java
index cac566c..7d59084 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_Z__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate_Z__V.java
@@ -1,9 +1,28 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallablePrivate_Z__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test(boolean arg) {
- trace();
- }
+ @LegacyClientCallable
+ private void test(boolean arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__D.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__D.java
index c176599..4ee4a38 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__D.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__D.java
@@ -1,10 +1,29 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallablePrivate__D extends BaseClientCallable {
- @LegacyClientCallable
- private double test() {
- trace();
- return 0.0;
- }
+ @LegacyClientCallable
+ private double test() {
+ trace();
+ return 0.0;
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__I.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__I.java
index d60bf00..41ae832 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__I.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__I.java
@@ -1,10 +1,29 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallablePrivate__I extends BaseClientCallable {
- @LegacyClientCallable
- private int test() {
- trace();
- return 0;
- }
+ @LegacyClientCallable
+ private int test() {
+ trace();
+ return 0;
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__Integer.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__Integer.java
index 05a646f..8da8c5a 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__Integer.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__Integer.java
@@ -1,10 +1,29 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallablePrivate__Integer extends BaseClientCallable {
- @LegacyClientCallable
- private Integer test() {
- trace();
- return 0;
- }
+ @LegacyClientCallable
+ private Integer test() {
+ trace();
+ return 0;
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonArray.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonArray.java
index 59285c4..404624f 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonArray.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonArray.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallablePrivate__JsonArray extends BaseClientCallable {
- @LegacyClientCallable
- private JsonArray test() {
- trace();
- return Json.createArray();
- }
+ @LegacyClientCallable
+ private JsonArray test() {
+ trace();
+ return Json.createArray();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonBoolean.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonBoolean.java
index 40abc55..2e96e3a 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonBoolean.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonBoolean.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallablePrivate__JsonBoolean extends BaseClientCallable {
- @LegacyClientCallable
- private JsonBoolean test() {
- trace();
- return Json.create(true);
- }
+ @LegacyClientCallable
+ private JsonBoolean test() {
+ trace();
+ return Json.create(true);
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonNull.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonNull.java
index f2a1a56..224923a 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonNull.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonNull.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallablePrivate__JsonNull extends BaseClientCallable {
- @LegacyClientCallable
- private JsonNull test() {
- trace();
- return Json.createNull();
- }
+ @LegacyClientCallable
+ private JsonNull test() {
+ trace();
+ return Json.createNull();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonNumber.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonNumber.java
index a7ee35e..3f0c732 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonNumber.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonNumber.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallablePrivate__JsonNumber extends BaseClientCallable {
- @LegacyClientCallable
- private JsonNumber test() {
- trace();
- return Json.create(0);
- }
+ @LegacyClientCallable
+ private JsonNumber test() {
+ trace();
+ return Json.create(0);
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonObject.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonObject.java
index d797e02..73dd6cc 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonObject.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonObject.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallablePrivate__JsonObject extends BaseClientCallable {
- @LegacyClientCallable
- private JsonObject test() {
- trace();
- return Json.createObject();
- }
+ @LegacyClientCallable
+ private JsonObject test() {
+ trace();
+ return Json.createObject();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonString.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonString.java
index 08545f4..4caeb32 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonString.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonString.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallablePrivate__JsonString extends BaseClientCallable {
- @LegacyClientCallable
- private JsonString test() {
- trace();
- return Json.create("");
- }
+ @LegacyClientCallable
+ private JsonString test() {
+ trace();
+ return Json.create("");
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonValue.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonValue.java
index f6eb10e..78d1f7f 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonValue.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__JsonValue.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallablePrivate__JsonValue extends BaseClientCallable {
- @LegacyClientCallable
- private JsonValue test() {
- trace();
- return Json.createObject();
- }
+ @LegacyClientCallable
+ private JsonValue test() {
+ trace();
+ return Json.createObject();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__V.java
index 8e6fb84..2bacf3e 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__V.java
@@ -1,9 +1,28 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallablePrivate__V extends BaseClientCallable {
- @LegacyClientCallable
- private void test() {
- trace();
- }
+ @LegacyClientCallable
+ private void test() {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__Z.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__Z.java
index 54a4d1f..27beb13 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__Z.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablePrivate__Z.java
@@ -1,10 +1,29 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallablePrivate__Z extends BaseClientCallable {
- @LegacyClientCallable
- private boolean test() {
- trace();
- return true;
- }
+ @LegacyClientCallable
+ private boolean test() {
+ trace();
+ return true;
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_D__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_D__V.java
index 21b6aef..6b2afc4 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_D__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_D__V.java
@@ -1,9 +1,28 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallable_D__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test(double arg) {
- trace();
- }
+ @LegacyClientCallable
+ public void test(double arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_I__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_I__V.java
index 24db69d..a106fa2 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_I__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_I__V.java
@@ -1,9 +1,28 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallable_I__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test(int arg) {
- trace();
- }
+ @LegacyClientCallable
+ public void test(int arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonArray__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonArray__V.java
index 7bebb78..12457f9 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonArray__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonArray__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonArray;
public class LegacyClientCallable_JsonArray__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test(JsonArray arg) {
- trace();
- }
+ @LegacyClientCallable
+ public void test(JsonArray arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonBoolean__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonBoolean__V.java
index 71f290f..f96f706 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonBoolean__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonBoolean__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonBoolean;
public class LegacyClientCallable_JsonBoolean__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test(JsonBoolean arg) {
- trace();
- }
+ @LegacyClientCallable
+ public void test(JsonBoolean arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonNull__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonNull__V.java
index 8f0be35..d085fc0 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonNull__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonNull__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonNull;
public class LegacyClientCallable_JsonNull__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test(JsonNull arg) {
- trace();
- }
+ @LegacyClientCallable
+ public void test(JsonNull arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonNumber__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonNumber__V.java
index 14774e5..27fcec0 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonNumber__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonNumber__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonNumber;
public class LegacyClientCallable_JsonNumber__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test(JsonNumber arg) {
- trace();
- }
+ @LegacyClientCallable
+ public void test(JsonNumber arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonObject__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonObject__V.java
index f433f4d..e60c7bd 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonObject__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonObject__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonObject;
public class LegacyClientCallable_JsonObject__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test(JsonObject arg) {
- trace();
- }
+ @LegacyClientCallable
+ public void test(JsonObject arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonString__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonString__V.java
index 4357afd..e7b8c32 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonString__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonString__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonString;
public class LegacyClientCallable_JsonString__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test(JsonString arg) {
- trace();
- }
+ @LegacyClientCallable
+ public void test(JsonString arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonValue__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonValue__V.java
index e1274a9..ccd37b6 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonValue__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_JsonValue__V.java
@@ -1,11 +1,30 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.JsonValue;
public class LegacyClientCallable_JsonValue__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test(JsonValue arg) {
- trace();
- }
+ @LegacyClientCallable
+ public void test(JsonValue arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_String__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_String__V.java
index 34b8dbf..3250749 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_String__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_String__V.java
@@ -1,9 +1,28 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallable_String__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test(String arg) {
- trace();
- }
+ @LegacyClientCallable
+ public void test(String arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_Z__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_Z__V.java
index 13a3413..9d191a0 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_Z__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_Z__V.java
@@ -1,9 +1,28 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallable_Z__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test(boolean arg) {
- trace();
- }
+ @LegacyClientCallable
+ public void test(boolean arg) {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__D.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__D.java
index 5ff6d1f..75db780 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__D.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__D.java
@@ -1,10 +1,29 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallable__D extends BaseClientCallable {
- @LegacyClientCallable
- public double test() {
- trace();
- return 0.0;
- }
+ @LegacyClientCallable
+ public double test() {
+ trace();
+ return 0.0;
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__I.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__I.java
index 3dc6375..942998e 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__I.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__I.java
@@ -1,10 +1,29 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallable__I extends BaseClientCallable {
- @LegacyClientCallable
- public int test() {
- trace();
- return 0;
- }
+ @LegacyClientCallable
+ public int test() {
+ trace();
+ return 0;
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__Integer.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__Integer.java
index feeacf1..ef7a71e 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__Integer.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__Integer.java
@@ -1,10 +1,29 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallable__Integer extends BaseClientCallable {
- @LegacyClientCallable
- public Integer test() {
- trace();
- return 0;
- }
+ @LegacyClientCallable
+ public Integer test() {
+ trace();
+ return 0;
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonArray.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonArray.java
index 9d5c6fc..983439a 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonArray.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonArray.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallable__JsonArray extends BaseClientCallable {
- @LegacyClientCallable
- public JsonArray test() {
- trace();
- return Json.createArray();
- }
+ @LegacyClientCallable
+ public JsonArray test() {
+ trace();
+ return Json.createArray();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonBoolean.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonBoolean.java
index f75221e..e8f27d9 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonBoolean.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonBoolean.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallable__JsonBoolean extends BaseClientCallable {
- @LegacyClientCallable
- public JsonBoolean test() {
- trace();
- return Json.create(true);
- }
+ @LegacyClientCallable
+ public JsonBoolean test() {
+ trace();
+ return Json.create(true);
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonNull.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonNull.java
index 9752510..3c24a83 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonNull.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonNull.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallable__JsonNull extends BaseClientCallable {
- @LegacyClientCallable
- public JsonNull test() {
- trace();
- return Json.createNull();
- }
+ @LegacyClientCallable
+ public JsonNull test() {
+ trace();
+ return Json.createNull();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonNumber.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonNumber.java
index 7e26cf7..48a2b8b 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonNumber.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonNumber.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallable__JsonNumber extends BaseClientCallable {
- @LegacyClientCallable
- public JsonNumber test() {
- trace();
- return Json.create(0);
- }
+ @LegacyClientCallable
+ public JsonNumber test() {
+ trace();
+ return Json.create(0);
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonObject.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonObject.java
index 2d91759..7073b06 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonObject.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonObject.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallable__JsonObject extends BaseClientCallable {
- @LegacyClientCallable
- public JsonObject test() {
- trace();
- return Json.createObject();
- }
+ @LegacyClientCallable
+ public JsonObject test() {
+ trace();
+ return Json.createObject();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonString.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonString.java
index bfbd375..51920cd 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonString.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonString.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallable__JsonString extends BaseClientCallable {
- @LegacyClientCallable
- public JsonString test() {
- trace();
- return Json.create("");
- }
+ @LegacyClientCallable
+ public JsonString test() {
+ trace();
+ return Json.create("");
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonValue.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonValue.java
index ff00ae3..66bb55f 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonValue.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__JsonValue.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import elemental.json.Json;
@@ -5,9 +24,9 @@
public class LegacyClientCallable__JsonValue extends BaseClientCallable {
- @LegacyClientCallable
- public JsonValue test() {
- trace();
- return Json.createObject();
- }
+ @LegacyClientCallable
+ public JsonValue test() {
+ trace();
+ return Json.createObject();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__V.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__V.java
index d41afcd..afc9444 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__V.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__V.java
@@ -1,9 +1,28 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallable__V extends BaseClientCallable {
- @LegacyClientCallable
- public void test() {
- trace();
- }
+ @LegacyClientCallable
+ public void test() {
+ trace();
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__Z.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__Z.java
index e53afdf..6890322 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__Z.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable__Z.java
@@ -1,10 +1,29 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
public class LegacyClientCallable__Z extends BaseClientCallable {
- @LegacyClientCallable
- public boolean test() {
- trace();
- return true;
- }
+ @LegacyClientCallable
+ public boolean test() {
+ trace();
+ return true;
+ }
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest.java
index fdb7b8f..1407db9 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest.java
@@ -1,7 +1,27 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+
import com.vaadin.flow.component.ClientCallable;
import com.vaadin.flow.component.Component;
import elemental.json.JsonValue;
@@ -22,7 +42,8 @@ public abstract class LegacyClientCallablesPrivateTest {
* @param c the instrumented callable instance
* @return the Method if found, null otherwise
*/
- private static Method getAnnotatedTestMethod(BaseClientCallable c, Class extends Annotation> annotationType) {
+ private static Method getAnnotatedTestMethod(
+ BaseClientCallable c, Class extends Annotation> annotationType) {
for (Method method : c.getClass().getDeclaredMethods()) {
if ("test".equals(method.getName()) && method.isAnnotationPresent(annotationType)) {
return method;
@@ -35,18 +56,20 @@ private static Method getAnnotatedTestMethod(BaseClientCallable c, Class exten
* Invokes the test method on the instrumented instance via reflection.
*
* @param instrumented the instrumented instance
- * @param args the arguments to pass to the test method
+ * @param args the arguments to pass to the test method
* @return the result of the method invocation
* @throws Exception if invocation fails
*/
- private static Object invokeTestMethod(BaseClientCallable instrumented, Object... args) throws Exception {
+ private static Object invokeTestMethod(BaseClientCallable instrumented, Object... args)
+ throws Exception {
Method testMethod = getAnnotatedTestMethod(instrumented, ClientCallable.class);
assertTrue(MESSAGE, testMethod != null);
testMethod.setAccessible(true);
return testMethod.invoke(instrumented, args);
}
- private static Object invokeLegacyMethod(BaseClientCallable instrumented, Object... args) throws Exception {
+ private static Object invokeLegacyMethod(BaseClientCallable instrumented, Object... args)
+ throws Exception {
Method testMethod = getAnnotatedTestMethod(instrumented, LegacyClientCallable.class);
testMethod.setAccessible(true);
return testMethod.invoke(instrumented, args);
@@ -67,7 +90,8 @@ private static Object invokeLegacyMethod(BaseClientCallable instrumented, Object
@Test
public void testExtends__V() throws Exception {
LegacyClientCallablePrivate__V instrumented =
- instrumentClass(ExtendsLegacyClientCallablePrivate__V.class).getDeclaredConstructor()
+ instrumentClass(ExtendsLegacyClientCallablePrivate__V.class)
+ .getDeclaredConstructor()
.newInstance();
invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -75,48 +99,60 @@ public void testExtends__V() throws Exception {
@Test
public void test__V() throws Exception {
- LegacyClientCallablePrivate__V instrumented = instrumentClass(LegacyClientCallablePrivate__V.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallablePrivate__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_Z__V() throws Exception {
- LegacyClientCallablePrivate_Z__V instrumented = instrumentClass(LegacyClientCallablePrivate_Z__V.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallablePrivate_Z__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate_Z__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, true);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_I__V() throws Exception {
- LegacyClientCallablePrivate_I__V instrumented = instrumentClass(LegacyClientCallablePrivate_I__V.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallablePrivate_I__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate_I__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, 42);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_D__V() throws Exception {
- LegacyClientCallablePrivate_D__V instrumented = instrumentClass(LegacyClientCallablePrivate_D__V.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallablePrivate_D__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate_D__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, 3.14);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_String__V() throws Exception {
- LegacyClientCallablePrivate_String__V instrumented = instrumentClass(LegacyClientCallablePrivate_String__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallablePrivate_String__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate_String__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, "test");
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test__Z() throws Exception {
- LegacyClientCallablePrivate__Z instrumented = instrumentClass(LegacyClientCallablePrivate__Z.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallablePrivate__Z instrumented =
+ instrumentClass(LegacyClientCallablePrivate__Z.class)
+ .getDeclaredConstructor()
+ .newInstance();
LegacyClientCallablePrivate__Z nonInstrumented = new LegacyClientCallablePrivate__Z();
boolean result = (boolean) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -125,8 +161,10 @@ public void test__Z() throws Exception {
@Test
public void test__I() throws Exception {
- LegacyClientCallablePrivate__I instrumented = instrumentClass(LegacyClientCallablePrivate__I.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallablePrivate__I instrumented =
+ instrumentClass(LegacyClientCallablePrivate__I.class)
+ .getDeclaredConstructor()
+ .newInstance();
LegacyClientCallablePrivate__I nonInstrumented = new LegacyClientCallablePrivate__I();
int result = (int) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -135,8 +173,10 @@ public void test__I() throws Exception {
@Test
public void test__D() throws Exception {
- LegacyClientCallablePrivate__D instrumented = instrumentClass(LegacyClientCallablePrivate__D.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallablePrivate__D instrumented =
+ instrumentClass(LegacyClientCallablePrivate__D.class)
+ .getDeclaredConstructor()
+ .newInstance();
LegacyClientCallablePrivate__D nonInstrumented = new LegacyClientCallablePrivate__D();
double result = (double) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -145,9 +185,12 @@ public void test__D() throws Exception {
@Test
public void test__Integer() throws Exception {
- LegacyClientCallablePrivate__Integer instrumented = instrumentClass(LegacyClientCallablePrivate__Integer.class)
- .getDeclaredConstructor().newInstance();
- LegacyClientCallablePrivate__Integer nonInstrumented = new LegacyClientCallablePrivate__Integer();
+ LegacyClientCallablePrivate__Integer instrumented =
+ instrumentClass(LegacyClientCallablePrivate__Integer.class)
+ .getDeclaredConstructor()
+ .newInstance();
+ LegacyClientCallablePrivate__Integer nonInstrumented =
+ new LegacyClientCallablePrivate__Integer();
Integer result = (Integer) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
assertEquals(invokeLegacyMethod(nonInstrumented), result);
@@ -155,9 +198,12 @@ public void test__Integer() throws Exception {
@Test
public void test__JsonValue() throws Exception {
- LegacyClientCallablePrivate__JsonValue instrumented = instrumentClass(LegacyClientCallablePrivate__JsonValue.class)
- .getDeclaredConstructor().newInstance();
- LegacyClientCallablePrivate__JsonValue nonInstrumented = new LegacyClientCallablePrivate__JsonValue();
+ LegacyClientCallablePrivate__JsonValue instrumented =
+ instrumentClass(LegacyClientCallablePrivate__JsonValue.class)
+ .getDeclaredConstructor()
+ .newInstance();
+ LegacyClientCallablePrivate__JsonValue nonInstrumented =
+ new LegacyClientCallablePrivate__JsonValue();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
assertEquals(((JsonValue) invokeLegacyMethod(nonInstrumented)).toJson(), result.toJson());
@@ -165,9 +211,12 @@ public void test__JsonValue() throws Exception {
@Test
public void test__JsonBoolean() throws Exception {
- LegacyClientCallablePrivate__JsonBoolean instrumented = instrumentClass(LegacyClientCallablePrivate__JsonBoolean.class)
- .getDeclaredConstructor().newInstance();
- LegacyClientCallablePrivate__JsonBoolean nonInstrumented = new LegacyClientCallablePrivate__JsonBoolean();
+ LegacyClientCallablePrivate__JsonBoolean instrumented =
+ instrumentClass(LegacyClientCallablePrivate__JsonBoolean.class)
+ .getDeclaredConstructor()
+ .newInstance();
+ LegacyClientCallablePrivate__JsonBoolean nonInstrumented =
+ new LegacyClientCallablePrivate__JsonBoolean();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
assertEquals(((JsonValue) invokeLegacyMethod(nonInstrumented)).toJson(), result.toJson());
@@ -175,9 +224,12 @@ public void test__JsonBoolean() throws Exception {
@Test
public void test__JsonNumber() throws Exception {
- LegacyClientCallablePrivate__JsonNumber instrumented = instrumentClass(LegacyClientCallablePrivate__JsonNumber.class)
- .getDeclaredConstructor().newInstance();
- LegacyClientCallablePrivate__JsonNumber nonInstrumented = new LegacyClientCallablePrivate__JsonNumber();
+ LegacyClientCallablePrivate__JsonNumber instrumented =
+ instrumentClass(LegacyClientCallablePrivate__JsonNumber.class)
+ .getDeclaredConstructor()
+ .newInstance();
+ LegacyClientCallablePrivate__JsonNumber nonInstrumented =
+ new LegacyClientCallablePrivate__JsonNumber();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
assertEquals(((JsonValue) invokeLegacyMethod(nonInstrumented)).toJson(), result.toJson());
@@ -185,9 +237,12 @@ public void test__JsonNumber() throws Exception {
@Test
public void test__JsonString() throws Exception {
- LegacyClientCallablePrivate__JsonString instrumented = instrumentClass(LegacyClientCallablePrivate__JsonString.class)
- .getDeclaredConstructor().newInstance();
- LegacyClientCallablePrivate__JsonString nonInstrumented = new LegacyClientCallablePrivate__JsonString();
+ LegacyClientCallablePrivate__JsonString instrumented =
+ instrumentClass(LegacyClientCallablePrivate__JsonString.class)
+ .getDeclaredConstructor()
+ .newInstance();
+ LegacyClientCallablePrivate__JsonString nonInstrumented =
+ new LegacyClientCallablePrivate__JsonString();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
assertEquals(((JsonValue) invokeLegacyMethod(nonInstrumented)).toJson(), result.toJson());
@@ -195,9 +250,12 @@ public void test__JsonString() throws Exception {
@Test
public void test__JsonNull() throws Exception {
- LegacyClientCallablePrivate__JsonNull instrumented = instrumentClass(LegacyClientCallablePrivate__JsonNull.class)
- .getDeclaredConstructor().newInstance();
- LegacyClientCallablePrivate__JsonNull nonInstrumented = new LegacyClientCallablePrivate__JsonNull();
+ LegacyClientCallablePrivate__JsonNull instrumented =
+ instrumentClass(LegacyClientCallablePrivate__JsonNull.class)
+ .getDeclaredConstructor()
+ .newInstance();
+ LegacyClientCallablePrivate__JsonNull nonInstrumented =
+ new LegacyClientCallablePrivate__JsonNull();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
assertEquals(((JsonValue) invokeLegacyMethod(nonInstrumented)).toJson(), result.toJson());
@@ -205,9 +263,12 @@ public void test__JsonNull() throws Exception {
@Test
public void test__JsonArray() throws Exception {
- LegacyClientCallablePrivate__JsonArray instrumented = instrumentClass(LegacyClientCallablePrivate__JsonArray.class)
- .getDeclaredConstructor().newInstance();
- LegacyClientCallablePrivate__JsonArray nonInstrumented = new LegacyClientCallablePrivate__JsonArray();
+ LegacyClientCallablePrivate__JsonArray instrumented =
+ instrumentClass(LegacyClientCallablePrivate__JsonArray.class)
+ .getDeclaredConstructor()
+ .newInstance();
+ LegacyClientCallablePrivate__JsonArray nonInstrumented =
+ new LegacyClientCallablePrivate__JsonArray();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
assertEquals(((JsonValue) invokeLegacyMethod(nonInstrumented)).toJson(), result.toJson());
@@ -215,9 +276,12 @@ public void test__JsonArray() throws Exception {
@Test
public void test__JsonObject() throws Exception {
- LegacyClientCallablePrivate__JsonObject instrumented = instrumentClass(LegacyClientCallablePrivate__JsonObject.class)
- .getDeclaredConstructor().newInstance();
- LegacyClientCallablePrivate__JsonObject nonInstrumented = new LegacyClientCallablePrivate__JsonObject();
+ LegacyClientCallablePrivate__JsonObject instrumented =
+ instrumentClass(LegacyClientCallablePrivate__JsonObject.class)
+ .getDeclaredConstructor()
+ .newInstance();
+ LegacyClientCallablePrivate__JsonObject nonInstrumented =
+ new LegacyClientCallablePrivate__JsonObject();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
assertEquals(((JsonValue) invokeLegacyMethod(nonInstrumented)).toJson(), result.toJson());
@@ -225,58 +289,71 @@ public void test__JsonObject() throws Exception {
@Test
public void test_JsonValue__V() throws Exception {
- LegacyClientCallablePrivate_JsonValue__V instrumented = instrumentClass(LegacyClientCallablePrivate_JsonValue__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallablePrivate_JsonValue__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate_JsonValue__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonNull());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonBoolean__V() throws Exception {
- LegacyClientCallablePrivate_JsonBoolean__V instrumented = instrumentClass(LegacyClientCallablePrivate_JsonBoolean__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallablePrivate_JsonBoolean__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate_JsonBoolean__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonBoolean());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonNumber__V() throws Exception {
- LegacyClientCallablePrivate_JsonNumber__V instrumented = instrumentClass(LegacyClientCallablePrivate_JsonNumber__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallablePrivate_JsonNumber__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate_JsonNumber__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonNumber());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonString__V() throws Exception {
- LegacyClientCallablePrivate_JsonString__V instrumented = instrumentClass(LegacyClientCallablePrivate_JsonString__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallablePrivate_JsonString__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate_JsonString__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonString());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonNull__V() throws Exception {
- LegacyClientCallablePrivate_JsonNull__V instrumented = instrumentClass(LegacyClientCallablePrivate_JsonNull__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallablePrivate_JsonNull__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate_JsonNull__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonNull());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonArray__V() throws Exception {
- LegacyClientCallablePrivate_JsonArray__V instrumented = instrumentClass(LegacyClientCallablePrivate_JsonArray__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallablePrivate_JsonArray__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate_JsonArray__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonArray());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonObject__V() throws Exception {
- LegacyClientCallablePrivate_JsonObject__V instrumented = instrumentClass(LegacyClientCallablePrivate_JsonObject__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallablePrivate_JsonObject__V instrumented =
+ instrumentClass(LegacyClientCallablePrivate_JsonObject__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonObject());
assertTrue(instrumented.hasBeenTraced());
}
-
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest24.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest24.java
index a73df01..a98879e 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest24.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest24.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import com.vaadin.flow.component.Component;
@@ -39,6 +58,4 @@ protected Object createJsonArray() {
protected Object createJsonObject() {
return Json.createObject();
}
-
-
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest25.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest25.java
index a6245ff..bd026b3 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest25.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesPrivateTest25.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import com.vaadin.flow.component.Component;
@@ -46,5 +65,4 @@ protected Object createJsonArray() {
protected Object createJsonObject() {
return new ObjectNode(JsonNodeFactory.instance);
}
-
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest.java
index c5e7052..4f298c2 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest.java
@@ -1,7 +1,27 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+
import com.vaadin.flow.component.ClientCallable;
import com.vaadin.flow.component.Component;
import elemental.json.JsonValue;
@@ -34,11 +54,12 @@ private static Method getClientCallableTestMethod(BaseClientCallable c) {
* Invokes the test method on the instrumented instance via reflection.
*
* @param instrumented the instrumented instance
- * @param args the arguments to pass to the test method
+ * @param args the arguments to pass to the test method
* @return the result of the method invocation
* @throws Exception if invocation fails
*/
- private static Object invokeTestMethod(BaseClientCallable instrumented, Object... args) throws Exception {
+ private static Object invokeTestMethod(BaseClientCallable instrumented, Object... args)
+ throws Exception {
Method testMethod = getClientCallableTestMethod(instrumented);
assertTrue(MESSAGE, testMethod != null);
return testMethod.invoke(instrumented, args);
@@ -58,48 +79,50 @@ private static Object invokeTestMethod(BaseClientCallable instrumented, Object..
@Test
public void test__V() throws Exception {
- LegacyClientCallable__V instrumented = instrumentClass(LegacyClientCallable__V.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallable__V instrumented =
+ instrumentClass(LegacyClientCallable__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_Z__V() throws Exception {
- LegacyClientCallable_Z__V instrumented = instrumentClass(LegacyClientCallable_Z__V.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallable_Z__V instrumented =
+ instrumentClass(LegacyClientCallable_Z__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, true);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_I__V() throws Exception {
- LegacyClientCallable_I__V instrumented = instrumentClass(LegacyClientCallable_I__V.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallable_I__V instrumented =
+ instrumentClass(LegacyClientCallable_I__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, 42);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_D__V() throws Exception {
- LegacyClientCallable_D__V instrumented = instrumentClass(LegacyClientCallable_D__V.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallable_D__V instrumented =
+ instrumentClass(LegacyClientCallable_D__V.class).getDeclaredConstructor().newInstance();
invokeTestMethod(instrumented, 3.14);
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_String__V() throws Exception {
- LegacyClientCallable_String__V instrumented = instrumentClass(LegacyClientCallable_String__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable_String__V instrumented =
+ instrumentClass(LegacyClientCallable_String__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, "test");
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test__Z() throws Exception {
- LegacyClientCallable__Z instrumented = instrumentClass(LegacyClientCallable__Z.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallable__Z instrumented =
+ instrumentClass(LegacyClientCallable__Z.class).getDeclaredConstructor().newInstance();
LegacyClientCallable__Z nonInstrumented = new LegacyClientCallable__Z();
boolean result = (boolean) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -108,8 +131,8 @@ public void test__Z() throws Exception {
@Test
public void test__I() throws Exception {
- LegacyClientCallable__I instrumented = instrumentClass(LegacyClientCallable__I.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallable__I instrumented =
+ instrumentClass(LegacyClientCallable__I.class).getDeclaredConstructor().newInstance();
LegacyClientCallable__I nonInstrumented = new LegacyClientCallable__I();
int result = (int) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -118,8 +141,8 @@ public void test__I() throws Exception {
@Test
public void test__D() throws Exception {
- LegacyClientCallable__D instrumented = instrumentClass(LegacyClientCallable__D.class).getDeclaredConstructor()
- .newInstance();
+ LegacyClientCallable__D instrumented =
+ instrumentClass(LegacyClientCallable__D.class).getDeclaredConstructor().newInstance();
LegacyClientCallable__D nonInstrumented = new LegacyClientCallable__D();
double result = (double) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -128,8 +151,8 @@ public void test__D() throws Exception {
@Test
public void test__Integer() throws Exception {
- LegacyClientCallable__Integer instrumented = instrumentClass(LegacyClientCallable__Integer.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable__Integer instrumented =
+ instrumentClass(LegacyClientCallable__Integer.class).getDeclaredConstructor().newInstance();
LegacyClientCallable__Integer nonInstrumented = new LegacyClientCallable__Integer();
Integer result = (Integer) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -138,8 +161,10 @@ public void test__Integer() throws Exception {
@Test
public void test__JsonValue() throws Exception {
- LegacyClientCallable__JsonValue instrumented = instrumentClass(LegacyClientCallable__JsonValue.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable__JsonValue instrumented =
+ instrumentClass(LegacyClientCallable__JsonValue.class)
+ .getDeclaredConstructor()
+ .newInstance();
LegacyClientCallable__JsonValue nonInstrumented = new LegacyClientCallable__JsonValue();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -148,8 +173,10 @@ public void test__JsonValue() throws Exception {
@Test
public void test__JsonBoolean() throws Exception {
- LegacyClientCallable__JsonBoolean instrumented = instrumentClass(LegacyClientCallable__JsonBoolean.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable__JsonBoolean instrumented =
+ instrumentClass(LegacyClientCallable__JsonBoolean.class)
+ .getDeclaredConstructor()
+ .newInstance();
LegacyClientCallable__JsonBoolean nonInstrumented = new LegacyClientCallable__JsonBoolean();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -158,8 +185,10 @@ public void test__JsonBoolean() throws Exception {
@Test
public void test__JsonNumber() throws Exception {
- LegacyClientCallable__JsonNumber instrumented = instrumentClass(LegacyClientCallable__JsonNumber.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable__JsonNumber instrumented =
+ instrumentClass(LegacyClientCallable__JsonNumber.class)
+ .getDeclaredConstructor()
+ .newInstance();
LegacyClientCallable__JsonNumber nonInstrumented = new LegacyClientCallable__JsonNumber();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -168,8 +197,10 @@ public void test__JsonNumber() throws Exception {
@Test
public void test__JsonString() throws Exception {
- LegacyClientCallable__JsonString instrumented = instrumentClass(LegacyClientCallable__JsonString.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable__JsonString instrumented =
+ instrumentClass(LegacyClientCallable__JsonString.class)
+ .getDeclaredConstructor()
+ .newInstance();
LegacyClientCallable__JsonString nonInstrumented = new LegacyClientCallable__JsonString();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -178,8 +209,10 @@ public void test__JsonString() throws Exception {
@Test
public void test__JsonNull() throws Exception {
- LegacyClientCallable__JsonNull instrumented = instrumentClass(LegacyClientCallable__JsonNull.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable__JsonNull instrumented =
+ instrumentClass(LegacyClientCallable__JsonNull.class)
+ .getDeclaredConstructor()
+ .newInstance();
LegacyClientCallable__JsonNull nonInstrumented = new LegacyClientCallable__JsonNull();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -188,8 +221,10 @@ public void test__JsonNull() throws Exception {
@Test
public void test__JsonArray() throws Exception {
- LegacyClientCallable__JsonArray instrumented = instrumentClass(LegacyClientCallable__JsonArray.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable__JsonArray instrumented =
+ instrumentClass(LegacyClientCallable__JsonArray.class)
+ .getDeclaredConstructor()
+ .newInstance();
LegacyClientCallable__JsonArray nonInstrumented = new LegacyClientCallable__JsonArray();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -198,8 +233,10 @@ public void test__JsonArray() throws Exception {
@Test
public void test__JsonObject() throws Exception {
- LegacyClientCallable__JsonObject instrumented = instrumentClass(LegacyClientCallable__JsonObject.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable__JsonObject instrumented =
+ instrumentClass(LegacyClientCallable__JsonObject.class)
+ .getDeclaredConstructor()
+ .newInstance();
LegacyClientCallable__JsonObject nonInstrumented = new LegacyClientCallable__JsonObject();
JsonValue result = (JsonValue) invokeTestMethod(instrumented);
assertTrue(instrumented.hasBeenTraced());
@@ -208,58 +245,71 @@ public void test__JsonObject() throws Exception {
@Test
public void test_JsonValue__V() throws Exception {
- LegacyClientCallable_JsonValue__V instrumented = instrumentClass(LegacyClientCallable_JsonValue__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable_JsonValue__V instrumented =
+ instrumentClass(LegacyClientCallable_JsonValue__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonNull());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonBoolean__V() throws Exception {
- LegacyClientCallable_JsonBoolean__V instrumented = instrumentClass(LegacyClientCallable_JsonBoolean__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable_JsonBoolean__V instrumented =
+ instrumentClass(LegacyClientCallable_JsonBoolean__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonBoolean());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonNumber__V() throws Exception {
- LegacyClientCallable_JsonNumber__V instrumented = instrumentClass(LegacyClientCallable_JsonNumber__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable_JsonNumber__V instrumented =
+ instrumentClass(LegacyClientCallable_JsonNumber__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonNumber());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonString__V() throws Exception {
- LegacyClientCallable_JsonString__V instrumented = instrumentClass(LegacyClientCallable_JsonString__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable_JsonString__V instrumented =
+ instrumentClass(LegacyClientCallable_JsonString__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonString());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonNull__V() throws Exception {
- LegacyClientCallable_JsonNull__V instrumented = instrumentClass(LegacyClientCallable_JsonNull__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable_JsonNull__V instrumented =
+ instrumentClass(LegacyClientCallable_JsonNull__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonNull());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonArray__V() throws Exception {
- LegacyClientCallable_JsonArray__V instrumented = instrumentClass(LegacyClientCallable_JsonArray__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable_JsonArray__V instrumented =
+ instrumentClass(LegacyClientCallable_JsonArray__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonArray());
assertTrue(instrumented.hasBeenTraced());
}
@Test
public void test_JsonObject__V() throws Exception {
- LegacyClientCallable_JsonObject__V instrumented = instrumentClass(LegacyClientCallable_JsonObject__V.class)
- .getDeclaredConstructor().newInstance();
+ LegacyClientCallable_JsonObject__V instrumented =
+ instrumentClass(LegacyClientCallable_JsonObject__V.class)
+ .getDeclaredConstructor()
+ .newInstance();
invokeTestMethod(instrumented, createJsonObject());
assertTrue(instrumented.hasBeenTraced());
}
-
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest24.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest24.java
index 27c7d21..7afbddc 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest24.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest24.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import com.vaadin.flow.component.Component;
@@ -39,6 +58,4 @@ protected Object createJsonArray() {
protected Object createJsonObject() {
return Json.createObject();
}
-
-
}
diff --git a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest25.java b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest25.java
index 0942a3d..f3f1557 100644
--- a/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest25.java
+++ b/src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest25.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * Json Migration Helper
+ * %%
+ * Copyright (C) 2025 Flowing Code
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package com.flowingcode.vaadin.jsonmigration;
import com.vaadin.flow.component.Component;
@@ -46,5 +65,4 @@ protected Object createJsonArray() {
protected Object createJsonObject() {
return new ObjectNode(JsonNodeFactory.instance);
}
-
}