users@jaxb.java.net

RE: Re: Method renaming

From: Burnett, Adam <Adam.Burnett_at_idearc.com>
Date: Wed, 7 Mar 2007 10:34:20 -0500

Are you saying that this already does what I'm trying to do or to look
at it for code examples?

-Adam

-----Original Message-----
From: Marcos [mailto:marcos_at_softingsystems.com.br]
Sent: Tuesday, March 06, 2007 4:20 PM
To: users_at_jaxb.dev.java.net
Subject: Re: Method renaming

Burnett, Adam escreveu:

>
> Hello, I'm attempting to write my first xjc plugin and running into
> some difficulty. I'm trying to rename methods based on their return
> type. Specifically I want to override the prefix added on to the
> field's accessor (getXX instead of isXX). I looked at writing a
> NameConverter but that doesn't give me access to what the data type of

> the field is.
>
> Next I tried iterating through all of the ClassOutline's and checking
> the fields to see if any of them were the type I'm interested in and
> then getting the CPropertyInfo for that FieldOutline and calling
> setName. But my name changes aren't showing up in the final generated

> source.
>
> So I then tried renaming the methods in the postProcessModel method of

> my plugin, but the problem there is that the default method prefix is
> still added by xjc. For example if I rename the method to
> "getWhatever" the generated source has "isgetWhatever". Also
> according to the docs using setName in postProcessModel is apparently
> a dangerous thing to do.
>
> I'm a little confused as to what part of the com.sun.tools.xjc package

> I should be looking at to accomplish this since there are so many
> outlines, models, info's, etc. Am I correct in that I can only
> accomplish this using the Outline in Plugin.run? Once I set the name
> of a method how do I get that to actually update the Outline? Or am I

> just totally off base?
>
> Thanks for the help and let me know if I need to supply more
information.
>
> _* *_
> *Adam Burnett*
> Idearc Media Corp.
> Internet Operations - Wireless Group
> 781-684-6776
>
> Visit _http://www.superpages.com_
>
Hi Adam,

I think the Property Change Listener Injector plugin can help you to
accomplish your appointment.
https://jaxb2-commons.dev.java.net/

Hope it helps

-- 
Marcos H. W.
Softing Systems
Systems Analyst
+55 11 38770360
/** 
 * @see https://jaxb2-commons.dev.java.net
 */
/**
 * "...Use the Force ...;-)" */
 *
 * @see http://www.gentoo.org/
 */
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net