如何摆脱从xmlbeans-maven-plugin生成的代码中的泛型警告? [英] How to get rid of generics warnings in code generated from xmlbeans-maven-plugin?

查看:146
本文介绍了如何摆脱从xmlbeans-maven-plugin生成的代码中的泛型警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些由xmlbeans-maven-plugin从xsd文件生成的代码。不幸的是,生成的代码使用原始的集合类型,如:

I have some code generated from xsd files by xmlbeans-maven-plugin. Unfortunately generated code uses raw collection types, like:

java.util.List targetList = new java.util.ArrayList();
get_store().find_all_element_users(CURRENCY$0, targetList);
Currency[] result = new Currency[targetList.size()];
targetList.toArray(result);

会导致很多警告。

有没有办法强制插件生成泛型类型或生成 @SupressWarnings 注释?
我使用maven v 2.0.9,xmlbeans-maven-plugin v 2.3.3

which causes lots of warnings.
Is there a way to force the plugin to generate generic types or generate @SupressWarnings annotations? I use maven v 2.0.9, xmlbeans-maven-plugin v 2.3.3

推荐答案

使用1.5的 javaSource参数生成基本代码。

You can probably just generate generified code using a javaSource parameter of 1.5.

这篇关于如何摆脱从xmlbeans-maven-plugin生成的代码中的泛型警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆