Class JsFunctionCallUtil

java.lang.Object
com.vaadin.tests.JsFunctionCallUtil

public final class JsFunctionCallUtil extends Object
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 Type
    Method
    Description
    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.
    static String
    getFunctionName(com.vaadin.flow.component.internal.UIInternals.JavaScriptInvocation invocation)
    Gets the name of the function that the given invocation calls.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 null if the invocation is not a function call, for example JavaScript scheduled with Element.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