@Retention(value=RUNTIME)
@Target(value=METHOD)
@Documented
public @interface JsProperty
JsType
as a property accessor and recognizes JavaBean
style naming convention. Instead of translating method calls to JsProperty methods as method
calls in JS, they will be replaced with dotted property lookups.
In case of JsType with JsProperties implemented by Java classes, the property access still triggers the execution of the matching getter or setter methods as they will be translated into custom property setter and getter in JavaScript.
Examples:
@JsProperty getX()
translates as this.x
@JsProperty x()
translates as this.x
@JsProperty setX(int y)
translates as this.x=y
@JsProperty x(int x)
translates as this.x=y
@JsProperty hasX(int x)
translates as x in this
In addition, fluent style return this syntax is supported for setters, so
@JsProperty T setX(int x)
translates as this.x=x, return this.
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
value |