Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用AutoBean实现带参数的方法?_Java_Gwt_Autobean - Fatal编程技术网

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