Interface JavaInvokable

All Superinterfaces:
Consumer<Object>, Function<Object,Object>, JavaCallable, Predicate<Object>, Runnable, Supplier<Object>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface JavaInvokable extends JavaCallable
  • Method Details

    • invoke

      Object invoke(Object... args)
    • call

      default Object call(Context context, Object[] args)
      Description copied from interface: JavaCallable
      Override with varargs for external Java client convenience. Callers can use: callable.call(ctx, arg1, arg2)
      Specified by:
      call in interface JavaCallable
    • isConstructable

      default boolean isConstructable()
      Whether this callable can be invoked with new. Default: false — only things that explicitly opt in (user-defined non-arrow functions, JsFunction subclasses, builtin constructor singletons, and the JsConstructor marker for Java-bridge types) report true. Used by the interpreter's construct path to throw a TypeError on new <non-constructor>(...) per spec.