users@jaxb.java.net

Re: Turn off annotations

From: alesque <agarino_at_hotmail.com>
Date: Thu, 30 Jul 2009 07:26:07 -0700 (PDT)

I found the setFieldRendererFactory method on Options object overriding
onActivated. I'm going to digg in this way...


alesque wrote:
>
> no0ne,
>
> I investigated to replace the bean generator and not found a way to do
> this. For sure I can override the bean generator, but how I can tell to
> xjc to use my own implementation from my plugin?
>
> Regards,
> Alexandre
>
>
>
> No 0ne wrote:
>>
>> On Wed, 2009-07-29 at 14:56 -0700, alesque wrote:
>>> I created a plugin and I tried to modify the in memory class model
>>> through
>>> the codemodel package. I didn't find any related methods to remove
>>> annotations.
>> There are none, the codemodel classes are used in building the code
>> model (rather than managing the code model).
>>>
>>> Can I remove annotations through the codemodel api?
>> Theoretically, yes. Use the reflection, set the private fields
>> accessible (see the java.lang.reflect.AccesibleObject) and manipulate
>> the data members of the codemodel classes directly (I reckon you'll be
>> interested in *starting* with the JDefinedClass#annotation data member).
>> Never done it myself (personal opinio: that's a hack, not a
>> construction), so if you want to do it this way, a sincere wish of "good
>> luck" in studying the source code in the codemodel.
>>
>> But since it's about writing a plugin *and* the study of the JAXB source
>> code, I'd recommend you to study the way xjc works, then
>> using/overriding/replacing the classes in
>> com.sun.tools.xjc.generator.bean.field package in your plugin (which
>> should build the classes in the way you need - as opposed to hack away
>> chunks of already "generated" code).
>>
>>>
>>> Regards,
>>> Alexandre
>>
>> Regards,
>>
>> no0ne
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>>
>>
>
>

-- 
View this message in context: http://www.nabble.com/Turn-off-annotations-tp24658417p24739501.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.