@Retention(value=RUNTIME)
@Target(value={METHOD,FIELD})
@Documented
public @interface JsProperty
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.