[ 
https://issues.apache.org/jira/browse/AXIS2-4462?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shameera Rathnayaka updated AXIS2-4462:
---------------------------------------

    Attachment: generatedClassAnnotationOption.patch

Hi all,

I was able to fix this for current trunk(1.7.0) . For this  i added a new 
option(-gca) for user to generate class annotation with a given value.

Simply it works like this, if user want to add Generated(value="myAnnot") then 
he needs to add "-gca myAnnot" to the WSDL2Java options, it will generate all 
classes with @Generated(value="myAnnot") without compilation errors( for the 
inner classes it would be  Generated("myAnnot")).  Let's say user add only 
"-gca" without a value then the default value is "axis2" 
                
> Add @Generated annotation on generated code
> -------------------------------------------
>
>                 Key: AXIS2-4462
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4462
>             Project: Axis2
>          Issue Type: Wish
>          Components: codegen
>            Reporter: Julien HENRY
>            Assignee: Amila Chinthaka Suriarachchi
>         Attachments: generatedClassAnnotationOption.patch
>
>
> It would be great to add an option in all code generator tools (especially 
> wsdl2java) to output @Generated annotation in generated classes [1].
> This way we would be able to automatically configure our code analysis tools 
> to ignore generated code.
> @Generated annotation is available for JDK 1.6 and optionally for JDK 1.5 
> using JSR 250 JAR [2].
> Please also note that @Generated support a value parameter that can be set to 
> the name of the generating tool. I suggest to hardcode it to "axis2" and 
> allow to override it in plugin parameters.
> So all classes generated by Axis2 would contains
> @Generated(value="axis2")
> [1] http://java.sun.com/javase/6/docs/api/javax/annotation/Generated.html
> [2] http://repo1.maven.org/maven2/javax/annotation/jsr250-api/1.0/

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org
For additional commands, e-mail: java-dev-h...@axis.apache.org

Reply via email to