gizmo icon indicating copy to clipboard operation
gizmo copied to clipboard

support package-info for package annotation

Open dufoli opened this issue 4 years ago • 10 comments

the need is to support package annotation. In cxf patch, I need to support this generation: https://github.com/apache/cxf/blob/master/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java#L234

dufoli avatar Mar 05 '20 04:03 dufoli

What is actually missing here? Is it just the flags that are wrong or is there something else missing?

stuartwdouglas avatar Mar 05 '20 05:03 stuartwdouglas

ClassCreator is usefull to generate a class with annotation /methods/fields but when I need to annotate only package without class. What can I use ?

here is an example: https://github.com/apache/cxf/blob/master/testutils/src/main/java/org/apache/cxf/customer/bare/package-info.java

dufoli avatar Mar 05 '20 13:03 dufoli

package-info is just a normal class file, can't you just generate a class named package-info and add class level anntoations?

stuartwdouglas avatar Mar 05 '20 20:03 stuartwdouglas

I have check by dumping my class file. Here is the result in idea:

package io.quarkus.it.cxf.quarkus_jaxws_asm;

@javax.xml.bind.annotation.XmlSchema(namespace = "http://cxf.it.quarkus.io/") public class $$package-info /* Real name is 'package-info' / { public $$package-info / Real name is 'package-info' /() { / compiled code */ } }

dufoli avatar Oct 16 '20 16:10 dufoli

I expect to have :

@javax.xml.bind.annotation.XmlSchema(namespace = "http://cxf.it.quarkus.io/") package io.quarkus.it.cxf.quarkus_jaxws_asm;

dufoli avatar Oct 16 '20 16:10 dufoli

I need feedback, for implementation of package info support before going further.

dufoli avatar Oct 16 '20 17:10 dufoli

Are you sure it does not already work? Just create a class called package-info

stuartwdouglas avatar Oct 18 '20 13:10 stuartwdouglas

I will retry with class creator

dufoli avatar Oct 19 '20 18:10 dufoli

indeed I can not test it because the important parameter is an enum. and enum has been fixed few weeks ago. So I will wait release to test it on my project .

dufoli avatar Oct 19 '20 20:10 dufoli

https://github.com/quarkusio/quarkus/pull/12814

stuartwdouglas avatar Oct 19 '20 22:10 stuartwdouglas