-
Notifications
You must be signed in to change notification settings - Fork 127
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
How to pass Custom Java object to LiquidCore #66
Comments
The annotations are not well documented, but you can do it like this: public class Person extends JSObject {
@jsexport(type = String.class)
Property<String> name;
@jsexport(type = Integer.class)
Property<Integer> age;
Person(JSContext ctx, String name, Integer age) {
super(ctx);
this.name.set(name);
this.age.set(age);
}
}; |
Thanks for your reply. How can i add it with @JsonProperty ? Actually I get response from Web Api then serial it with @JsonProperty Can i do this?
|
I don't know much about String myJSONString = "..."; // I assume you can get this from ObjectMapper
JSValue person = JSON.parse(jsContext, myJSONString); But I am not sure if this is any different than what you originally did, so it may have similar performance issues. |
Wow, thanks JSON.parse(jsContext, myJSONString) really helps alot for me and boost performance |
Hi I have a class Person as:
The text was updated successfully, but these errors were encountered: