org.apidesign.bck2brwsr.core

## Annotation Type JavaScriptBody

-     @Retention(value=CLASS)
       @Target(value={METHOD,CONSTRUCTOR})
      public @interface JavaScriptBody

  Put this annotation on a method to provide its special implementation in JavaScript. This is a way to define native methods that interact with the surrounding environment.
  Author:
    Jaroslav Tulach

- - ### Required Element Summary

    Required Elements
    Modifier and Type | Required Element and Description
    --- | ---
    `String[]` | `args` Names of parameters for the method generated method that can be referenced from `body()`.
    `String` | `body` The actual body of the method in JavaScript.

- - ### Element Detail

    - #### args

          public abstract String[] args

      Names of parameters for the method generated method that can be referenced from `body()`.
      Returns:
        array of the names of parameters for the method in JavaScript

  - - #### body

          public abstract String body

      The actual body of the method in JavaScript. This string will be put into generated header (ends with '{') and footer (ends with '}'). The body can reference provided arguments. In case of non-static instance method it may reference `this`. It can also call methods and access fields - if proper mangling is used. Methods that return some value should end with `return` statement.

Copyright © 2025 API Design. All Rights Reserved.