Java 如何使用AutoBean实现带参数的方法?
我有以下界面:Java 如何使用AutoBean实现带参数的方法?,java,gwt,autobean,Java,Gwt,Autobean,我有以下界面: public interface beanExample { public BigDecimal norm(BigDecimal dec); } 然后我为它创建了一个类别: public class beanExampleCategory { public static BigDecimal norm(BigDecimal dec) { return dec != null ? dec : BigDecimal.ZERO; } } 我的工厂看起来像
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();
}
我试着用几种方法来解决,但我不知道如何解决它
如何使用AutoBean实现带有参数的方法?您的category方法必须将
AutoBean
作为其第一个参数
看
[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