[forge-dev] Hello World Template

George Gastaldi ggastald at redhat.com
Sun Mar 30 16:31:51 EDT 2014


Your code should work, you can't use @Inject outside Furnace environment.  Not sure what's going on, need to investigate a little further

> Em 30/03/2014, às 17:26, Antonio Goncalves <antonio.mailing at gmail.com> escreveu:
> 
> Good old NPE ;o)
> 
> I'm not running the code into a container, so @Inject does not work. In the readme there is the addonRegistry method. In all the samples, the registery is injected... but how do I use all that with a good old Main ?
> 
> 
> 2014-03-30 22:17 GMT+02:00 George Gastaldi <ggastald at redhat.com>:
>> Why it doesn't work? Is any exception being thrown?
>> 
>>> Em 30/03/2014, às 17:14, Antonio Goncalves <antonio.mailing at gmail.com> escreveu:
>>> 
>> 
>>> Hum...
>>> 
>>> In the README there is :
>>> 
>>> @Inject private TemplateProcessorFactory factory
>>> 
>>> But is there a way to use the templating from a Main class ? If I use Forge, I have Furnace as a container, and I was trying something like this, but it doesn't work : 
>>> Furnace furnace = startFurnace();
>>> Imported<TemplateProcessorFactory> imported = furnace.getAddonRegistry(TemplateProcessorFactory.class);
>>> TemplateProcessorFactory factory = imported.get();
>>> 
>>> Any simple Hello World from a Main class and a pom.xml ?
>>> 
>>> Thanks
>>> Antonio
>>> 
>>> 
>>> 2014-03-29 19:03 GMT+01:00 George Gastaldi <ggastald at redhat.com>:
>>>> Hi Antonio,
>>>> 
>>>> Roaster currently only maintains a class structure (add/remove fields, methods, interfaces,etc), not code (method bodies) at the moment. 
>>>> 
>>>> There is a JIRA to allow that though.
>>>> 
>>>> See the templates addon README to learn how to generate content from a template.
>>>> 
>>>> Best Regards,
>>>> 
>>>> George Gastaldi
>>>> 
>>>>> Em 29/03/2014, às 14:43, Antonio Goncalves <antonio.mailing at gmail.com> escreveu:
>>>>> 
>>>> 
>>>>> Hi all,
>>>>> 
>>>>> I'm starting to get a bit more confident with Roaster... and now I would like to add templating. If I'm right, Roaster is nice to add bits and pieces of Java here and there, but it's better to use Templates when there is a lot of code, and mix templating and Roaster for better code customization.
>>>>> 
>>>>> Is there a sample I could use to write a Hello Word ? A template with an "engine" that uses Roaster to add Java code to the template.
>>>>> 
>>>>> Thanks
>>>>> 
>>>>> -- 
>>>>> Antonio Goncalves 
>>>>> Software architect and Java Champion
>>>>> 
>>>>> Web site | Twitter | LinkedIn | Paris JUG | Devoxx France
>>>>> _______________________________________________
>>>>> forge-dev mailing list
>>>>> forge-dev at lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>> 
>>>> _______________________________________________
>>>> forge-dev mailing list
>>>> forge-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>> 
>>> 
>>> 
>>> -- 
>>> Antonio Goncalves 
>>> Software architect and Java Champion
>>> 
>>> Web site | Twitter | LinkedIn | Paris JUG | Devoxx France
>>> _______________________________________________
>>> forge-dev mailing list
>>> forge-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>> 
>> _______________________________________________
>> forge-dev mailing list
>> forge-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-dev
> 
> 
> 
> -- 
> Antonio Goncalves 
> Software architect and Java Champion
> 
> Web site | Twitter | LinkedIn | Paris JUG | Devoxx France
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20140330/49240f91/attachment.html 


More information about the forge-dev mailing list