GraalJS Java interoperability tools.

Constructors

Methods

  • Greates a shallow copy of given Java array or list. This is usually unnecessary, because you can use the Java arrays and lists directly as well.

    Type Parameters

    • T

    Parameters

    • obj: T[]

      Java array or list.

    Returns T[]

    JavaScript array.

  • Converts a JavaScript value to Java type. This is usually handled automatically.

    Parameters

    • value: any

      JavaScript value.

    • javaType: any

      Java type to convert it to.

    Returns any

    Java object.

  • Gets type name of given Java class instance.

    Parameters

    • value: any

      Value to get type name for.

    Returns undefined | string

    Type name of given class instance, or undefined if a value that is not a class instance was given.