Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify non-native @JsType support for Java 16 records #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions java/jsinterop/annotations/JsProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
*
* <p>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
* as property lookups. When a JsProperty method is implemented by a Java class, such methods will
* be generated as property accessors in JavaScript, hence the property access will trigger the
* execution of the matching getter or setter methods.
*
* <p>JsProperty follows JavaBean style naming convention to extract the default property name. If
Expand All @@ -39,6 +39,11 @@
* <li>{@code @JsProperty setX(int y)} translates as {@code this.x=y}
* </ul>
*
* <p>When applied to {@code record} components, the annotation will only apply to the accessor and
* not to the field - otherwise this would result in a naming conflict. Additionally, the JavaBean
* style convention is not required, as record accessors do not being with {@code get-} or
* {@code is-}.
*
* <p>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.
*/
Expand Down
2 changes: 1 addition & 1 deletion java/jsinterop/annotations/JsType.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
* <p>Marking an object with JsType is similar to marking each public member of the class with
* {@link JsProperty}/{@link JsMethod}/{@link JsConstructor} respectively. In order for this to work
* correctly the JavaScript name needs to be unique for each member. Some unobvious ways to cause
* correctly the JavaScript name needs to be unique for each member. Some nonobvious ways to cause
* name collisions are:
*
* <ul>
Expand Down