BIRT 3.7
Written by: Michael Williams
Featured Refcardz: Top Refcardz:
  1. HTML5 Canvas
  2. Ruby
  3. iPhone/iPad
  4. Spring Web Flow
  5. REST
  1. jQuery Selectors
  2. Spring Config.
  3. Java
  4. Ajax
  5. Java Concurrency

Link Details

Link 462419 thumbnail
User 183524 avatar

By jschneider
via blog.cedarsoft.com
Published: Aug 07 2010 / 06:34

Everybody uses code generation. Every day. Most of the times a templating enginge is used. That is great for simple cases. But for more complex things like generating complete classes, there exists a nice (but forgotten?) API for that purpose.
  • 23
  • 0
  • 4831
  • 2

Comments

Add your comment
User 447031 avatar

iirekm replied ago:

1 votes Vote down Vote up Reply

Nice, I didn't know that such such convenience library exists.
I wrote lots about code generation and metaprogramming recently on my blog: http://coding-masters.blogspot.com/2010/07/metaprogramming-in-java.html

No we have a few different reflection APIs:
- the one from java.lang.reflect and javax.beans (read only, from loaded .class files)
- the one from Javassist and similar projects (read-write, for .class files, either loaded to JVM or not)
- 'mirror' API from APT (read only, from .java files)
- the API you present here (to .java files)

I would be happy if there existed an API that unified those 4 APIs into one superapi for reflection, manipulation of .class and .java files - in fact they are about the same thing, only the most 'persistence' part of these APIs is different.

User 183524 avatar

jschneider replied ago:

0 votes Vote down Vote up Reply

One API to rule them all... Could be nice. But I don't know if this is really possible... But if you give it a try: I'd like to take a look at it ;-)

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.