Antonio Goncalves created FORGE-2225:
----------------------------------------
Summary: Being able to create a new CDI producer method
Key: FORGE-2225
URL:
https://issues.jboss.org/browse/FORGE-2225
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.14.0.Final
Reporter: Antonio Goncalves
It would be good to have a command to add a CDI producer method to an existing class. A
simple command such as :
{code}
cdi-new-producer-method --named produceLogger --returnType org.apache.logging.log4j.Logger
--accessType private
{code}
Would generate :
{code}
public class LoggingProducer
{
@Produces
public Logger produceLogger() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
{code}
We can also have a parameter to add the injection point
{code}
cdi-new-producer-method --named produceLogger --returnType org.apache.logging.log4j.Logger
--accessType private --injectionPoint
{code}
Would generate :
{code}
public class LoggingProducer
{
@Produces
public Logger produceLogger(InjectionPoint injectionPoint) {
throw new UnsupportedOperationException("Not supported yet.");
}
}
{code}
Then, we can have more attributes :
{code}
cdi-new-producer-method --named produceLogger --returnType org.apache.logging.log4j.Logger
--accessType private --injectionPoint --qualifier Production --alternative=true --scoped
Request --atNamed=true
{code}
{code}
public class LoggingProducer
{
@Produces
@Production
@Alternative
@RequestScoped
@Named
public Logger produceLogger() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)