Package com.vaadin.tests
Class JsFunctionCallUtil
java.lang.Object
com.vaadin.tests.JsFunctionCallUtil
Helpers for inspecting the invocations that
Element.callJsFunction(String, Object...) schedules.
The client is sent the name of the function and the arguments of the call rather than JavaScript that names the function, so every such invocation carries the same expression and the called function can only be told from the call itself.
-
Method Summary
Modifier and TypeMethodDescriptiongetArguments(com.vaadin.flow.component.internal.UIInternals.JavaScriptInvocation invocation) Gets the arguments that the given invocation calls its function with, without the name of the function and the element it is called on.static StringgetFunctionName(com.vaadin.flow.component.internal.UIInternals.JavaScriptInvocation invocation) Gets the name of the function that the given invocation calls.
-
Method Details
-
getFunctionName
public static String getFunctionName(com.vaadin.flow.component.internal.UIInternals.JavaScriptInvocation invocation) Gets the name of the function that the given invocation calls.- Parameters:
invocation- the invocation to read the function name from- Returns:
- the name of the called function, or
nullif the invocation is not a function call, for example JavaScript scheduled withElement.executeJs(String, Object...)
-
getArguments
public static List<Object> getArguments(com.vaadin.flow.component.internal.UIInternals.JavaScriptInvocation invocation) Gets the arguments that the given invocation calls its function with, without the name of the function and the element it is called on.- Parameters:
invocation- the invocation to read the arguments from- Returns:
- the arguments of the call, or an empty list if the invocation is not a function call
-