apt-jelly-users Mailing List for APT-Jelly
Brought to you by:
stoicflame
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(3) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Doug Ly <dml...@gm...> - 2010-06-28 03:00:27
|
Hi, Is there a way to refer to a template fmt file in classpath (another jar file) instead of a separated fmt file? Thanks |
From: Jeff P. <je...@je...> - 2010-03-19 15:38:15
|
According to the documentation (http://apt-jelly.sourceforge.net/directives.html#ifHasAnnotation ), the <@ifHasAnnotation> directive supports a declaration attribute. Not so, according to this runtime exception. (I'm using apt-jelly 2.6 with freemarker 2.3.16, the current version. Could this be a version skew issue?) /JEP [apt] 2010-03-19 10:59:06,468 [ERROR] freemarker.runtime - [apt] [apt] The 'ifHasAnnotation' transform doesn't support the 'declaration' attribute of type String. [apt] The problematic instruction: [apt] ---------- [apt] ==> user-directive ifHasAnnotation [on line 73, column 1 in file:/C:/bl/opsmgr/dev/8_1_job_plugin/jobs/nulljob/psc.fmt] [apt] in user-directive forAllMethods [on line 63, column 1 in file:/C:/bl/opsmgr/dev/8_1_job_plugin/jobs/nulljob/psc.fmt] [apt] in user-directive forAllTypes [on line 28, column 1 in file:/C:/bl/opsmgr/dev/8_1_job_plugin/jobs/nulljob/psc.fmt] [apt] in user-directive file [on line 2, column 1 in file:/C:/ bl/opsmgr/dev/8_1_job_plugin/jobs/nulljob/psc.fmt] [apt] ---------- [apt] [apt] Java backtrace for programmers: [apt] ---------- [apt] freemarker.template.TemplateModelException: The 'ifHasAnnotation' transform doesn't support the 'declaration' attribute of type String. [apt] at net .sf .jelly .apt .freemarker.FreemarkerTransform.setupStrategy(FreemarkerTransform.java: 78) [apt] at net .sf .jelly .apt.freemarker.FreemarkerTransform.getWriter(FreemarkerTransform.java: 56) [apt] at freemarker.core.Environment.visit(Environment.java: 284) [apt] at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.MixedContent.accept(MixedContent.java:92) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.Environment.visit(Environment.java: 297) [apt] at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.MixedContent.accept(MixedContent.java:92) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.Environment.visit(Environment.java: 297) [apt] at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.MixedContent.accept(MixedContent.java:92) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.Environment.visit(Environment.java: 297) [apt] at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.MixedContent.accept(MixedContent.java:92) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.Environment.process(Environment.java:188) [apt] at freemarker.template.Template.process(Template.java: 237) [apt] at net .sf .jelly .apt.freemarker.FreemarkerProcessor.process(FreemarkerProcessor.java:55) [apt] Problem encountered during annotation processing; [apt] at com.sun.mirror.apt.AnnotationProcessors $CompositeAnnotationProcessor.process(AnnotationProcessors.java:60) [apt] see stacktrace below for more information. [apt] java.lang.RuntimeException: freemarker.template.TemplateModelException: The 'ifHasAnnotation' transform doesn't support the 'declaration' attribute of type String. [apt] at com.sun.tools.apt.comp.Apt.main(Apt.java:454) [apt] at net .sf .jelly .apt.freemarker.FreemarkerProcessor.process(FreemarkerProcessor.java:80) [apt] at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:258) [apt] at net .sf .jelly .apt.freemarker.FreemarkerProcessor.process(FreemarkerProcessor.java:61) [apt] at com.sun.tools.apt.main.Main.compile(Main.java:1102) [apt] at com.sun.mirror.apt.AnnotationProcessors $CompositeAnnotationProcessor.process(AnnotationProcessors.java:60) [apt] at com.sun.tools.apt.comp.Apt.main(Apt.java:454) [apt] at com.sun.tools.apt.main.Main.compile(Main.java:964) [apt] at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:258) [apt] at com.sun.tools.apt.Main.processing(Main.java:95) [apt] at com.sun.tools.apt.main.Main.compile(Main.java:1102) [apt] at com.sun.tools.apt.Main.process(Main.java:43) [apt] at com.sun.tools.apt.main.Main.compile(Main.java:964) [apt] at com.sun.tools.apt.Main.main(Main.java:34) [apt] at com.sun.tools.apt.Main.processing(Main.java:95) [apt] at com.sun.tools.apt.Main.process(Main.java:43) [apt] at com.sun.tools.apt.Main.main(Main.java:34) [apt] Caused by: freemarker.template.TemplateModelException: The 'ifHasAnnotation' transform doesn't support the 'declaration' attribute of type String. [apt] at net .sf .jelly .apt .freemarker.FreemarkerTransform.setupStrategy(FreemarkerTransform.java: 78) [apt] at net .sf .jelly .apt.freemarker.FreemarkerTransform.getWriter(FreemarkerTransform.java: 56) [apt] at freemarker.core.Environment.visit(Environment.java: 284) [apt] at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.MixedContent.accept(MixedContent.java:92) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.Environment.visit(Environment.java: 297) [apt] at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.MixedContent.accept(MixedContent.java:92) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.Environment.visit(Environment.java: 297) [apt] at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.MixedContent.accept(MixedContent.java:92) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.Environment.visit(Environment.java: 297) [apt] at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.MixedContent.accept(MixedContent.java:92) [apt] at freemarker.core.Environment.visit(Environment.java: 208) [apt] at freemarker.core.Environment.process(Environment.java:188) [apt] at freemarker.template.Template.process(Template.java: 237) [apt] at net .sf .jelly .apt.freemarker.FreemarkerProcessor.process(FreemarkerProcessor.java:55) [apt] ... 8 more |
From: Ryan H. <sto...@us...> - 2007-01-30 14:28:39
|
Awesome. I'm glad we found the problem. Hopefully, Sun will fix that bug so that the error handling will be less obscure in the future. Much appreciation for your glowing feedback for the project. I'm just glad I'm able to contribute something that others like to use, since I wrote it in the first place just to scratch a personal itch. And I agree that I might get a bit too obsessive-compulsive on the code structure. It might be more difficult to pick up what's going on, but I ca= n tell you it makes big pay-offs later in terms of refactoring and enhancements. I do monitor the dev list, and I'd be thrilled to entertain any thoughts yo= u might have for enhancements or improvements. It's there for that purpose, but it hasn't ever been used. I don't know if that's a good thing or a bad thing ;-). -Ryan On 1/29/07, Brian Greene <br...@st...> wrote: > > Got it =96 that was it. Long story, but I'm actually running a shared s= et > of templates over multiple projects so I have a project (and a build file= ) > that is called from each of them (I've got it down to an antcall with 4 > params rather than the rather long apt task I'd have to repeat otherwise)= . > I wasn't passing the classpath reference and as such was getting the erro= r > described as the task in the default location was using a different > classpath. > > > > As an aside =96 what a wonderful piece of code apt-jelly is. I've blogge= d > about it a bit and will continue to do so as it works quite nicely. It's > really clean (too clean sometimes =96 takes a long time to grok with all = the > inheritance and generics) and I'm trying to work out a few extensions=85 > we'll see. I've managed to do some interesting things with my own > annotations though, and overall am having a blast with it. > > > > Do you monitor the dev list? I have some thoughts I'd like to chat about > that would be better captured there. I'm a big fan of code generation, a= nd > would like to see apt-jelly become the defacto standard that XDoclet once > was, and would love to chat on that more. > > > > At any rate, thanks again for the project and the quick tip. > > > > -Brian > > > ------------------------------ > > *From:* apt...@li... [mailto: > apt...@li...] *On Behalf Of *Ryan Heaton > *Sent:* Monday, January 29, 2007 10:46 AM > *To:* apt...@li... > *Subject:* Re: [apt-jelly-users] getting closer to the jaxb problem > > > > A quick google search on the error found this: > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=3D6432333 > > Sounds a lot like what you're encountering. This would imply that the > jaxb-2.0-api.jar isn't on your APT classpath when you invoke APT. > > -Ryan > > On 1/29/07, *Ryan Heaton* < sto...@gm...> wrote: > > I've looked into this a bit more, but I'm still stumped. My suspicions > lean towards something awry in your environment, but I'm about as far as = I > can go without more information. If you can reproduce it in a test case = (or > give me a way to reproduce it in a test case), I'd be able to figure out > what's going on. More information about your environment might also be > helpful: > > -It's a long shot, but do you happen to have another class that is named > "XmlAttribute" in either your source base or your classpath? > -What's does the executable look like when executing APT? (try ant -v) > Are you sure the jaxb-2.0-api.jar is on the classpath when invoking APT? > > -Ryan > > > > > On 1/28/07, *Ryan Heaton* < sto...@us...> wrote: > > Thanks for the report, Brian. > > It's an elusive one. I can tell you that I'm using JAXB 2.0 annotations > with APT-Jelly, and I've never seen this one. There really shouldn't be > anything special about JAXB 2.0 annotations; they're the same as any othe= r > annotation. > > I'd really like to be able to reproduce it in a test. Can you send me > more of the stack trace? > > -Ryan > > > On 1/27/07, *Brian Greene* <br...@st...> wrote: > > So this is a segment of the output from running apt when using one of > the JAXB annotations. Just got it to appear (turned off forking the apt > exec task =96 yes still in ant 1.6.x). Haven't dissected it yet, but I'm > hoping it will be more meaningful to a user on the list or Ryan. > > > > symbol : class XmlAttribute > > [* exec*] location: class com.bob.corp.scn.model.SourceCustomer > > [* exec*] @XmlAttribute(name=3D"foo") > > [* exec*] ^ > > [* exec*] error: Could not create declaration for annotation type > XmlAttribute > > [* exec*] Problem encountered during annotation processing; > > [* exec*] see stacktrace below for more information. > > [* exec*] *java.lang.ClassCastException*: > com.sun.tools.apt.mirror.type.ClassTypeImpl > > [* exec*] at > com.sun.tools.apt.mirror.declaration.AnnotationMirrorImpl.getAnnotationTy= pe > (*AnnotationMirrorImpl.java:82 *) > > [*exec* ] at > net.sf.jelly.apt.decorations.declaration.DecoratedAnnotationMirror.<init>= ( > *DecoratedAnnotationMirror.java:47 *) > > > > Thanks, > > > > Brian > > > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.432 / Virus Database: 268.17.12/654 - Release Date: 1/27/200= 7 > 5:02 PM > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > > _______________________________________________ > Apt-jelly-users mailing list > Apt...@li... > https://lists.sourceforge.net/lists/listinfo/apt-jelly-users > > > > > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.432 / Virus Database: 268.17.14/657 - Release Date: 1/29/200= 7 > 9:04 AM > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.432 / Virus Database: 268.17.14/657 - Release Date: 1/29/200= 7 > 9:04 AM > |
From: Ryan H. <sto...@gm...> - 2007-01-29 16:46:25
|
A quick google search on the error found this: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=3D6432333 Sounds a lot like what you're encountering. This would imply that the jaxb-2.0-api.jar isn't on your APT classpath when you invoke APT. -Ryan On 1/29/07, Ryan Heaton <sto...@gm...> wrote: > > I've looked into this a bit more, but I'm still stumped. My suspicions > lean towards something awry in your environment, but I'm about as far as = I > can go without more information. If you can reproduce it in a test case = (or > give me a way to reproduce it in a test case), I'd be able to figure out > what's going on. More information about your environment might also be > helpful: > > -It's a long shot, but do you happen to have another class that is named > "XmlAttribute" in either your source base or your classpath? > -What's does the executable look like when executing APT? (try ant -v) > Are you sure the jaxb-2.0-api.jar is on the classpath when invoking APT? > > -Ryan > > > > On 1/28/07, Ryan Heaton < sto...@us...> wrote: > > > > Thanks for the report, Brian. > > > > It's an elusive one. I can tell you that I'm using JAXB 2.0 annotation= s > > with APT-Jelly, and I've never seen this one. There really shouldn't b= e > > anything special about JAXB 2.0 annotations; they're the same as any > > other annotation. > > > > I'd really like to be able to reproduce it in a test. Can you send me > > more of the stack trace? > > > > -Ryan > > > > > > > > On 1/27/07, Brian Greene <br...@st...> wrote: > > > > > So this is a segment of the output from running apt when using one o= f > > > the JAXB annotations. Just got it to appear (turned off forking the = apt > > > exec task =96 yes still in ant 1.6.x). Haven't dissected it yet, but > > > I'm hoping it will be more meaningful to a user on the list or Ryan. > > > > > > > > > > > > symbol : class XmlAttribute > > > > > > [* exec*] location: class com.bob.corp.scn.model.SourceCustomer > > > > > > [* exec*] @XmlAttribute(name=3D"foo") > > > > > > [* exec*] ^ > > > > > > [* exec*] error: Could not create declaration for annotation typ= e > > > XmlAttribute > > > > > > [* exec*] Problem encountered during annotation processing; > > > > > > [* exec*] see stacktrace below for more information. > > > > > > [* exec*] * java.lang.ClassCastException*: > > > com.sun.tools.apt.mirror.type.ClassTypeImpl > > > > > > [* exec*] at > > > com.sun.tools.apt.mirror.declaration.AnnotationMirrorImpl.getAnnotati= onType > > > (*AnnotationMirrorImpl.java:82 *) > > > > > > [*exec* ] at > > > net.sf.jelly.apt.decorations.declaration.DecoratedAnnotationMirror > > > .<init>(*DecoratedAnnotationMirror.java:47 *) > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Brian > > > > > > -- > > > No virus found in this outgoing message. > > > Checked by AVG Free Edition. > > > Version: 7.5.432 / Virus Database: 268.17.12/654 - Release Date: > > > 1/27/2007 5:02 PM > > > > > > > > > ---------------------------------------------------------------------= ---- > > > Take Surveys. Earn Cash. Influence the Future of IT > > > Join SourceForge.net's Techsay panel and you'll get the chance to > > > share your > > > opinions on IT & business topics through brief surveys - and earn cas= h > > > > > > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CI= D=3DDEVDEV > > > > > > _______________________________________________ > > > Apt-jelly-users mailing list > > > Apt...@li... > > > https://lists.sourceforge.net/lists/listinfo/apt-jelly-users > > > > > > > > > > > > |
From: Ryan H. <sto...@gm...> - 2007-01-29 16:44:41
|
I've looked into this a bit more, but I'm still stumped. My suspicions lea= n towards something awry in your environment, but I'm about as far as I can g= o without more information. If you can reproduce it in a test case (or give me a way to reproduce it in a test case), I'd be able to figure out what's going on. More information about your environment might also be helpful: -It's a long shot, but do you happen to have another class that is named "XmlAttribute" in either your source base or your classpath? -What's does the executable look like when executing APT? (try ant -v) Ar= e you sure the jaxb-2.0-api.jar is on the classpath when invoking APT? -Ryan On 1/28/07, Ryan Heaton <sto...@us...> wrote: > > Thanks for the report, Brian. > > It's an elusive one. I can tell you that I'm using JAXB 2.0 annotations > with APT-Jelly, and I've never seen this one. There really shouldn't be > anything special about JAXB 2.0 annotations; they're the same as any othe= r > annotation. > > I'd really like to be able to reproduce it in a test. Can you send me > more of the stack trace? > > -Ryan > > > > On 1/27/07, Brian Greene <br...@st...> wrote: > > > So this is a segment of the output from running apt when using one of > > the JAXB annotations. Just got it to appear (turned off forking the ap= t > > exec task =96 yes still in ant 1.6.x). Haven't dissected it yet, but I= 'm > > hoping it will be more meaningful to a user on the list or Ryan. > > > > > > > > symbol : class XmlAttribute > > > > [* exec*] location: class com.bob.corp.scn.model.SourceCustomer > > > > [* exec*] @XmlAttribute(name=3D"foo") > > > > [* exec*] ^ > > > > [* exec*] error: Could not create declaration for annotation type > > XmlAttribute > > > > [* exec*] Problem encountered during annotation processing; > > > > [* exec*] see stacktrace below for more information. > > > > [* exec*] * java.lang.ClassCastException*: > > com.sun.tools.apt.mirror.type.ClassTypeImpl > > > > [* exec*] at > > com.sun.tools.apt.mirror.declaration.AnnotationMirrorImpl.getAnnotation= Type > > (*AnnotationMirrorImpl.java:82 *) > > > > [*exec* ] at > > net.sf.jelly.apt.decorations.declaration.DecoratedAnnotationMirror > > .<init>(*DecoratedAnnotationMirror.java:47 *) > > > > > > > > Thanks, > > > > > > > > Brian > > > > -- > > No virus found in this outgoing message. > > Checked by AVG Free Edition. > > Version: 7.5.432 / Virus Database: 268.17.12/654 - Release Date: > > 1/27/2007 5:02 PM > > > > > > -----------------------------------------------------------------------= -- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > > your > > opinions on IT & business topics through brief surveys - and earn cash > > > > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID= =3DDEVDEV > > > > _______________________________________________ > > Apt-jelly-users mailing list > > Apt...@li... > > https://lists.sourceforge.net/lists/listinfo/apt-jelly-users > > > > > > > |
From: Brian G. <br...@st...> - 2007-01-28 05:14:17
|
So this is a segment of the output from running apt when using one of = the JAXB annotations. Just got it to appear (turned off forking the apt = exec task =96 yes still in ant 1.6.x). Haven=92t dissected it yet, but I=92m = hoping it will be more meaningful to a user on the list or Ryan. =20 symbol : class XmlAttribute [exec] location: class com.bob.corp.scn.model.SourceCustomer [exec] @XmlAttribute(name=3D"foo") [exec] ^ [exec] error: Could not create declaration for annotation type XmlAttribute [exec] Problem encountered during annotation processing; [exec] see stacktrace below for more information. [exec] java.lang.ClassCastException: com.sun.tools.apt.mirror.type.ClassTypeImpl [exec] at com.sun.tools.apt.mirror.declaration.AnnotationMirrorImpl.getAnnotationTy= pe( AnnotationMirrorImpl.java:82) [exec] at net.sf.jelly.apt.decorations.declaration.DecoratedAnnotationMirror.<init>= (De coratedAnnotationMirror.java:47) =20 Thanks, =20 Brian --=20 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.17.12/654 - Release Date: = 1/27/2007 5:02 PM =20 |
From: Brian G. <br...@st...> - 2007-01-28 05:04:38
|
Good evening, =20 I=92m having great luck using apt-jelly, and am grateful for a tool = (after years of XDoclet it is a huge step forward in terms of usability). =20 I am having an issue though=85 as soon as I use any of the jaxb 2.0 annotations in a class that is processed, things go haywire=85 I=92ve = been doing some reading on the issue, and I=92m aware of the strong ties = between a jaxb specific processor and apt, but I=92m not even sure where to look = in the apt jelly codebase for a start to solving the problem. As I=92m = starting apt as a forked process it=92s a bit difficult to debug, and I=92ve had no = luck hooking up Freemarker to log4j=85 any help, a pointer in the right = direction would be greatly appreciated. =20 Thanks, and if there=92s any other detail I can give, please let me = know. If this doesn=92t make sense, try putting a jaxb 2.0 annotation in your = classes that you=92re processing and watch apt silently fail=85 =20 Brian --=20 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.17.12/654 - Release Date: = 1/27/2007 5:02 PM =20 |
From: Ryan H. <sto...@us...> - 2006-12-14 17:59:30
|
Yep. Use the templateURL option and let me know if it doesn't work. Thanks! -Ryan On 12/14/06, Rohnny Moland <rm...@gm...> wrote: > Ok, Im just tired. See now that it is a -AtemplateURL option that I > probably can use. > > R. > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Apt-jelly-users mailing list > Apt...@li... > https://lists.sourceforge.net/lists/listinfo/apt-jelly-users > |
From: Rohnny M. <rm...@gm...> - 2006-12-14 16:04:06
|
Ok, Im just tired. See now that it is a -AtemplateURL option that I probably can use. R. |
From: Rohnny M. <rm...@gm...> - 2006-12-14 15:36:54
|
Hi, I am using apt-jelly with maven 2 (with multiple modules). For now I specify in the pom for the modules that should be processed: .. <aptOptions>template=mytemplate.jelly</aptOptions> .. This works if I put the template in the root of my pom tree. I would like to put the template in a jar file, because that is cleaner and I dont want to put the template in more than one place. So, what I am trying to say is that it would be nice if I could use something like: <aptOptions>template=jar://template.jar!/mytemplate.jelly</aptOptions> Then I can just add a template.jar with the template inside as a dependency to pom module that needs it. Btw: Thanks for this great tool. Saves me from using many hours and frustration writing for loops in java. ;-) Best regards, Rohnny |
From: KLM <kl...@us...> - 2006-08-03 10:42:33
|
Thanks for the nice features of Apt-Jelly. I have a hard time though, setting up a productive environment for writing templates using : Eclipse + Freemarker IDE plugin + FreeMarker + Apt-Jelly + Ant 1.7. My environment doesn't seem to be stable, and produce erratic behavior. I don't know what software is responsible for what concern ... The following need of mine is very general, so I suggest to have it bundled with the Apt-Jelly download (or next to it, or with the Eclipse Freemarker IDE plugin). ----------------------- In the Eclipse IDE plugin, I want to specify many Apt-Jelly classes as a context at the project level. This enables all (Apt-Jelly + freemarker) templates in the project to enjoy completion, in two ways : 1. it helps me follow a common naming convention for variable names (according to their type only, which is far from perfect but is already something). This improves maintainability, especially in our case where I won't be the one maintaining them. 2. given a variable with such a constrained name, the IDE lists the possible completions after a dot, which dramatically changes the learning curve, reduces typos, and somehow speeds things up. Note : The IDE seems to deduce the context from the getters of the class or interface configured. These classes need no implementation, although the real class should be just fine also. -------------------- Example : Setup : register the variable name "classType" to class "net.sf.jelly.apt.decorations.type.DecoratedClassType" Benefit 1 : in the template, typing "${cl" triggers the suggestion for "${classType", validated with Enter. Benefit 2 : in the template, the string "${classType." will list suggestions, along with their java type : * declaration - com.sun.mirror.declaration.ClassDeclaration * superclass - com.sun.mirror.type.ClassType * class - boolean * actualTypeArguments - java.util.Collection * ... ---------------------- Problems : as I wrote earlier, my environment is not stable, and many aspects don't work as expected. I sure wish I could use this feature out of the box ! :-) I suppose other people have the same need (maybe most Apt-Jelly + Freemarker + Eclipse users ?) |
From: Konan L. <kon...@gm...> - 2006-08-03 09:09:56
|
I'm using freemarker with Apt-Jelly, as a static generation tool. I'm having many concerns, it's probably me ... but let's start with this one. I decorated a Java interface with an annotation of mine. I can use several ways to get to the annotation itself, but can't get the annotation values. My annotation is << package pack; public @interface NEcMock { String myOption() default "optionMy"; } >> My annotated class is << @pack.NEcMock( myOption = "newOption") public interface IEcMockableSample extends IEcMarkerBean { } >> I want access to : 1. the annotation element : myOption() or myOption 2. its default value : "optionMy" 3. its value : "newOption" I tried many things in the template, nothing works. ---- Freemarker example with Apt-Jelly <@ifHasAnnotation var="annotationMirror" annotation=myAnnotation> Has annotation mirror : ${annotationMirror.elementValues?size} </@ifHasAnnotation> It returns "Has annotation mirror : 0" !! ---- Freemarker-only example Freemarker only : ${type.annotationMirrors[0].elementValues?size} It returns "Freemarker only : 0" !! I tried many other ways, all the ones I could think of in fact. I'm dry right now ;-) !!! The context part is taken care for me, because I use apt-jelly out of the box, launched from the ant 1.7 task. I have no outside code that could be faulty :-) ! Any help would be appreciated :-) KLM |
From: Nicolas L. <nic...@va...> - 2006-07-12 09:45:22
|
Hi, =20 I am thinking about new features for apt-jelly. It concerns the directives which are filterable by annotation ( like @forAllMethods, @forAllTypes...). Here is my proposition : - Add an option to exclude declaration which are annotated with specified annotations. It looks like this : =20 <@forAllTypes var=3D"type" annotation=3D"MyAnnotation" = annotationVar=3D"ann" excludes=3D"AnAnnotation, AnotherAnnotation"> =20 What do you think about it ? =20 Nicolas. =20 |
From: Nicolas L. <nic...@va...> - 2006-07-03 18:58:34
|
Hi ! =20 I am currently working with the file directive. I need further information about it. Especially about the package option. It works fine with a single directory (like "cfg") But instead I set a fully directory, like "bin/cfg", a NullPointerException is thrown. Here is the stack trace : =20 Problem encountered during annotation processing; see stacktrace below for more information. java.lang.NullPointerException at net.sf.jelly.apt.strategies.TemplateOutputRedirectionStrategy.postProces s(TemplateOutputRedirectionStrategy.java:52) at net.sf.jelly.apt.freemarker.FreemarkerTemplateBlock.close(FreemarkerTemp lateBlock.java:108) at freemarker.core.Environment.visit(Environment.java:265) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:116) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:232) at org.highway.ejbgen.FreemarkerEjbGenProcessor.process(FreemarkerEjbGenPro cessor.java:98) at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.pro cess(AnnotationProcessors.java:60) at com.sun.tools.apt.comp.Apt.main(Apt.java:454) at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:448) at com.sun.tools.apt.main.Main.compile(Main.java:1075) at com.sun.tools.apt.main.Main.compile(Main.java:938) at com.sun.tools.apt.Main.processing(Main.java:95) at com.sun.tools.apt.Main.process(Main.java:54) at org.highway.AptTask.execute(AptTask.java:397) =20 Can you tell me if it is a bug or if I forget something ? =20 Nicolas. |
From: Nicolas L. <nic...@va...> - 2006-06-29 14:30:02
|
Hi, =20 Just a simple question. Is there any "else" tag associated to the @IfHasAnnotation directive ? And what is the syntax ? =20 Regards. Nicolas. =20 |
From: Nicolas L. <nic...@va...> - 2006-06-23 16:13:06
|
Hi Ryan, =20 Here is the situation. A problem appeared when I use the tag @forAllTypes with the annotation parameter. The template should iterate over the list of type filtered with the annotation set in option. It's work fine unless the annotation is not in the first position. =20 For example : =20 @AnAnnotation @AnotherAnnotation Public class MyClass{ //...// } =20 If the template starts with :=20 <@forAllTypes var=3D"type" annotation=3D"AnAnnotation"> You can parse your class declaration. =20 But if the template starts with : <@forAllTypes var=3D"type" annotation=3D" AnotherAnnotation "> You can not parse the class declaration. =20 =20 =20 The source code problem is located in the class : net.sf.jelly.apt.strategies and in the method : protected boolean hasAnnotation(D declaration, String annotationName) =20 I give you, one possible solution (the one I carry out for my project) : Replace the code by : @Override protected boolean hasAnnotation(TypeDeclaration declaration, String annotationName) { for (AnnotationMirror mirror : declaration.getAnnotationMirrors()) { AnnotationTypeDeclaration annotation =3D mirror.getAnnotationType().getDeclaration(); if (annotation.getQualifiedName().equals(annotationName)) { return true; } } return false; }=20 =20 =20 =20 I hope it is enough clear. I don t have enough time at this moment to give you more detailed explanations. But don't hesitate to contact me for more details. =20 Nicolas. |
From: Nicolas L. <nic...@va...> - 2006-06-22 15:05:33
|
Hi, =20 I am starting using apt-jelly libraries. I found out a bug. Could you tell me where can I report it ? =20 Nicolas. =20 |
From: Ryan H. <sto...@th...> - 2006-05-24 18:42:30
|
This is a welcome message for the apt-jelly-users mailing list. Don't be deterred by the apparent inactivity of the list! This is a new project, but the lists are open. I encourage you to subscribe and use the lists as you need them. Thanks! -Ryan |