jsinterop.annotations

## Annotation Type JsProperty

-     @Retention(value=RUNTIME)
       @Target(value={METHOD,FIELD})
       @Documented
      public @interface JsProperty

  JsProperty marks a field or method that is translated directly into a JavaScript property preserving its name.

  If it is applied to a method, it will be treated as a property accessor. As a result, instead of translating method calls to JsProperty methods as method calls in JS, they will be translated as property lookups. When a JsProperty method implemented by a Java class, such methods will be generated as property accessor in JavaScript, hence the property access will trigger the execution of the matching getter or setter methods.

  JsProperty follows JavaBean style naming convention to extract the default property name. If the JavaBean convention is not followed, the name should be set explicitly. For example:

  - `@JsProperty getX()` or `@JsProperty isX()` translates as `this.x`
  - `@JsProperty setX(int y)` translates as `this.x=y`

  Note: In JavaScript, instance members are defined on the prototype and class members are defined on the constructor function of the type which mimics ES6 class style.

- - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `java.lang.String` | `name` Customizes the name of the member in generated JavaScript.
    `java.lang.String` | `namespace` Customizes the namespace of the static member in generated JavaScript.

- - ### Element Detail

    - #### name

          public abstract java.lang.String name

      Customizes the name of the member in generated JavaScript. If none is provided;
      - if it is field, the simple Java name will be used.
      - if it is a method, the name will be generated based on JavaBean conventions.
      Default:
        "<auto>"

  - - #### namespace

          public abstract java.lang.String namespace

      Customizes the namespace of the static member in generated JavaScript. If none is provided, namespace is the enclosing class' fully qualified JavaScript name.
      Default:
        "<auto>"