users
[Top] [All Lists]

Fwd: [cinjug-users] Searching for annotations

To: "users@xxxxxxxxxx" <users@xxxxxxxxxx>
Subject: Fwd: [cinjug-users] Searching for annotations
From: "Edward Sumerfield" <esumerfd@xxxxxxxxx>
Date: Tue, 11 Jul 2006 12:14:18 -0400
Delivered-to: mailing list users@cinjug.org
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=W19oQPnoV7/N81vFhhnTFUDofukf+MguylJkG6ALEl8XyHpMHA/xkiwl7yd1MQabfxA4epoBY0669e2prOnOuIHohXCkeO08huiYZaUFDp3bH+Vi5KmTMEbw6s56/S6SUYMv8fIDBzKHdNjfNMyJdVqaCtN9GSY9yfr8RO51Bh0=
In-reply-to: <6a216ba20607110913s144bf075k2e33f7c107b8c260@mail.gmail.com>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <14015846.1152631986555.JavaMail.root@webmail2> <029301c6a503$86ae1b80$6b01a8c0@CARMANI9300> <6a216ba20607110913s144bf075k2e33f7c107b8c260@mail.gmail.com>
Reply-to: esumerfd@xxxxxxxxxxxxxx
So why can't I unzip the jar, reflect into each of the classes and check for interfaces or annotations? I was just hoping that someone had written the code for me.

I have found it really hard to find good documentation on writting annotations. Lots on how to use them though. The best link is from IBM with a part 1 and 2 about them. Good detail on how to ensure that they get included in the javadoc with the @Document annotation etc.

   http://www-128.ibm.com/developerworks/java/library/j-annotate1/



On 7/11/06, James Carman <james@xxxxxxxxxxxxxxxxxxxx> wrote:
Shame on you, Jon. :-)  Annotations are not pesky, nor are they compiled
out.  They are available at runtime via reflection if you give them the
correct retention policy (RetentionPolicy.RUNTIME).

But, you can't find all classes at runtime that have a specific annotation,
just like you can't find all classes that implement an interface.  You need
to do some sort of pre-processing using APT to lookup those classes and
write them to a file or something (like I do with my Hibernate APT
processor).

-----Original Message-----
From: inmanjon@xxxxxxxx [mailto: inmanjon@xxxxxxxx]
Sent: Tuesday, July 11, 2006 11:33 AM
To: James Carman
Cc: users@xxxxxxxxxx; esumerfd@xxxxxxxxxxxxxx
Subject: RE: [cinjug-users] Searching for annotations

Hello,

It wouldn't seem you could find those pesky things in a jar?

I think they are compiled out, at least the ones where somebody has built
their own annotation factory most certainly are.  Can you find the runtime
ones?

I was happily surprised to see them in JavaDoc, but yeah some bean
reflection or javadoc stud could probably find those.

good luck..



---- James Carman < james@xxxxxxxxxxxxxxxxxxxx> wrote:
> What are you trying to do?
>
>
>
>   _____
>
> From: Edward Sumerfield [mailto: esumerfd@xxxxxxxxx ]
> Sent: Tuesday, July 11, 2006 10:32 AM
> To: users@xxxxxxxxxx
> Subject: [cinjug-users] Searching for annotations
>
>
>
> Are there any libraries out there that would help me find my annotations
at
> the classpath or jar level?
>
> --
> Ed
>


---------
You may unsubscribe from this mailing list
by sending a blank email addressed to:
users-unsubscribe@xxxxxxxxxx

--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx



---------
You may unsubscribe from this mailing list
by sending a blank email addressed to:
users-unsubscribe@xxxxxxxxxx

--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx




--
Ed


--
Ed
<Prev in Thread] Current Thread [Next in Thread>