我有以下界面:
public interface beanExample {
public BigDecimal norm(BigDecimal dec);
}
然后我为它创建一个类别:
public class beanExampleCategory {
public static BigDecimal norm(BigDecimal dec) {
return dec != null ? dec : BigDecimal.ZERO;
}
}
和我的工厂看起来像:
@Category(beanExampleCategory.class)
public interface myFactory extends AutoBeanFactory {
AutoBean<beanExample> mybean();
}
但是当我编译时我得到了那些错误:
[ERROR] The beanExample parameterization is not simple
and the following methods did not have static implementations:
[ERROR] public abstract java.math.BigDecimal norm(java.math.BigDecimal dec)
[ERROR] Unable to complete due to previous errors
我尝试解决几种方法,但我无法弄清楚如何解决它!
如何使用AutoBean的params实现方法?
答案 0 :(得分:0)
您的类别方法必须以AutoBean<beanExample>
作为其第一个参数。
请参阅https://code.google.com/p/google-web-toolkit/wiki/AutoBean#Categories