Avoiding Compiler warnings on code generated by xjc

北战南征 提交于 2019-12-10 16:49:44

问题


My root question is how to benefit from the 'unchecked generics type' Eclipse compiler warning, but not have the list of those warnings in the Problems view polluted by noise from java classes which are generated from xsd files by xjc (via maven-jaxb2-plugin.)

I've read other places that I can ignore compiler warnings per source folder and that would be great, but I don't have the authority to place the generated code it it's own source folder. :(

Given my situation, my assumption is that the easiest and most durable way to do this would be to use jaxb binding files (.xjb) to add @SuppressWarnings at the class level of all of the classes that jaxb generates. However I'm not very smart on using xjc, I just see how it/maven/eclipse are wired together to generate .java files from the .xsd files. So this leads to 2 questions. First, am I wrong to think this possible/easy? Second, if that is easy what's a good way at getting started on accomplishing this?

来源:https://stackoverflow.com/questions/19917257/avoiding-compiler-warnings-on-code-generated-by-xjc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!