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

Feature request: Allow methods with @Template("toProperty") for object creation blocks #94

Closed
micw opened this issue Jul 27, 2015 · 2 comments

Comments

@micw
Copy link

commented Jul 27, 2015

Currently an object creation block is only allowed for properties. There's a template "toProperty" that creates js properties from java methods these should also be allowed within object creation blocks.

Example:

class MyData {
@template("toProperty")
public native void myprop1(String value);

public String myprop2;
}

Should allow definitions as:

new MyData() {{
myprop1("prop1");
myprop2="prop2";
}}

@micw

This comment has been minimized.

Copy link
Author

commented Jul 27, 2015

Great work, thank you a lot!

But is it really a good idea to check for the "toProperty" template name?

@npiguet

This comment has been minimized.

Copy link
Member

commented Jul 27, 2015

Well this particular one is part of the core templates and the
correspondance between the template name and it's implementation is already
hard-coded somewhere else in the generator, so it doesn't seem like much of
a problem right now.

It might be a bit nicer to move the template names to their respective
classes instead of leaving those strings hard-coded in unrelated classes,
but for now that'll do.

On July 28, 2015 12:22:52 AM micw notifications@github.com wrote:

Great work, thank you a lot!

But is it really a good idea to check for the "toProperty" template name?


Reply to this email directly or view it on GitHub:
#94 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.