« Return to Thread: custom AnnotationReader

custom AnnotationReader

by Herve Bitteur-2 :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

Speaking of a "custom AnnotationReader to read annotations from an external file", this might be the right approach for handling Java sources the user cannot annotate. We had a discussion a few days ago about marshalling JRE classes such as classes Point or Dimension in java.awt package. For example, how can we specify that we'll use attributes rather than elements? In the case of "non-annotable" classes, some external file could be the answer.

Just my 2 cents
/Hervé

Subject:
Re: Making JAXBContextImpl serializable
From:
Kohsuke Kawaguchi Kohsuke.Kawaguchi@...
Date:
Fri, 10 Nov 2006 11:57:40 -0800
To:
users@...
To:
users@...

Kohsuke Kawaguchi wrote:
I should see what's going on in your profile that's taking long...

I made one more minor improvement, but it looks like the rest is mostly dominated by the reflection, so without taking more drastic measure, this seems like the best we can get for now.

One possibility is to use a custom AnnotationReader to read annotations from an external file or something. That might be faster than using reflection.

The other possibility is to analyze JAXB bound classes lazily, but that has a spec-related problem of not being able to detect errors early enough (which might be acceptable for enough audience, though) and it probably takes a significant modification of the RI.


--
Hervé Bitteur
Software Program Manager
Sun Microsystems, Inc.
13, Avenue Morane Saulnier
78142 Vélizy Cedex FRANCE
Phone +33 1 34 03 01 12
Mobile +33 6 86 49 04 14
Fax     +33 1 34 03 07 56
Email   herve.bitteur@...
Skype hbitteur

 « Return to Thread: custom AnnotationReader