treblereel / mapper-xml

j2cl/gwt compatible XML marshallers
Apache License 2.0
3 stars 3 forks source link

Include gwt3-processor annotations when generating (un)marshaller #80

Closed manstis closed 3 years ago

manstis commented 3 years ago

I am using mapper-xml to generate (un)marshallers from Java POJOs.

I can add @JsType and @GWT3Export to the POJOs themselves with a XJC extension (as they are generated from a XSD). However I have to manually tweak the (un)marshallers before compiling the lot with J2CL.

Wouldn't it be nice if I could have the @JsType and @GWT3Export annotations added to the (un)marshallers when they are generated. Perhaps the POJO could have a marker annotation to suggest its (un)marshaller needs to have the @JsType/@GWT3Export annotations added when it is generated?

IDK, something like:

@XMLMapper
@GenerateGWT3Export
public class MyDTO {
...
}
treblereel commented 3 years ago

@manstis Good idea, thanks ! I think it could be nice to be able to add any annotations, not only @Gwt3Exports, maybe one day we ll need @JsType with params, so in the linked PR is my proposal how it could be achieved. That do you think ?

manstis commented 3 years ago

Looks good to me. Thank-you @treblereel.

manstis commented 3 years ago

Thanks for the fix @treblereel.