0

当我使用 iPOJO 和 @Requires 注释时,它不会注入到消费者中。

消费者:

@Component
@Provides
@Instantiate
@Content(name = "bean")
public class BeanContentHandler extends ContentHandler
{  
    @Requires
    private IContentMapper mapper;

提供者:

@Component
@Provides
public class JcromContentMapper implements IContentMapper
{
    protected static final Jcrom JCROM = new Jcrom(true, false);
4

1 回答 1

0

我看到两个潜在的问题:

  • @Content 注释在做什么?
  • 您的提供程序未实例化(在其上添加 @Instantiate 注释)

你能告诉我映射器字段在哪里使用吗?

于 2014-04-30T06:57:45.580 回答