users@jaxb.java.net

RE: Plugin for EJB 3.0 annotations

From: Scott Allan <sallan1000_at_aol.com>
Date: Fri, 12 Aug 2005 13:22:20 -0500

> I'm not sure what you mean by "element level", but perhaps you mean

> customization attached to element declarations that are bound to

> JAXBElement.

 That is exactly what I mean. Just like this:



             <xs:element name="de011" type="stringType">

                 <xs:annotation><xs:appinfo>

                                    <ejb3:annotate className="MyClass"
param="myparam" value="myvalue"/>

                             </xs:appinfo></xs:annotation>

                        </xs:element>



> What you can do is to use Model.getAllElements() to get to

> all element

> mappings (CElementInfo). This class extends from

> CCustomizable, so you

> can access all the customizations attached to it.



Trying that now. So far, this code does not find the customization.
(Wrong place error) I'll keep playing with it...



    public boolean run(Outline outline, Options opt, ErrorHandler
errorHandler) {

          Model m = outline.getModel();

          for ( CElementInfo cei : m.getAllElements())

          {

            CCustomizations custList = cei.getCustomizations();

            for (CPluginCustomization c : custList){

            Element e = c.element;

            System.out.println(e.getTagName());

            c.markAsAcknowledged();

            }

           

          }

   }



> Hope the above explanation helps. Otherwise perhaps you could

> explain me

> what you want to achieve (like where you'd like to put an annotation.)





I need annotations at the start of the class declaration and I got that
working. It looks like I will need to put annotations before the
individual setter and getter methods but will need to specify which
method gets the annotation.



Thanks.




  _____

<< ella for Spam Control >> has removed 25191 Spam messages and set
aside 2 Newsletters for me
You can use it too - and it's FREE! www.ellaforspam.com