我有一个生成 SimpleDateFromat 对象的 JEE6 简单生产者类:
public class myProducer {
@Produces public SimpleDateFormat produceASimpleDateFormat(final InjectionPoint injectionPoint)
{
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
}
}
我想要:
- 创建一个新的生产者,并以某种方式能够在类中指定 DateFormat 被注入的位置或......
- 编辑我现有的 Producer 以根据传递的参数生成不同的 SimpleDateFormat。
我应该如何最好地实现它?