• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Practical example of METADATA feature i nJDK1.5

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm not able to understand MetaData feature. Can you provide practical example and sample code.

thanks
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I write J2EE applications, I often find myself 'annotating' my code in such a way that XDoclet (an open source third party application) can parse my annotations and generate some meaningful output in the given context.

One big annoyance is that XDoclet relies on annotations placed in javadoc comments, which means that at runtime, this information is lost.
It would be nice (and will be nice) when I can reflect upon my annotations at runtime. In order to provide this ability (to reflect at runtime), a language change had to be made (or I guess a third-party could implement some kind of pre-processor).
This is one that application that immediately springs to mind; I'm sure if I thought hard enough, I could come up with more.
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Annotation
 
We don't have time to be charming! Quick, read this tiny ad:
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic