users@jaxb.java.net

Re: Re: no get and set methods generated

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Thu, 9 Oct 2008 11:58:00 +0200

The conditionsType restricts xs:anyType. So, anything, in any order,
can be there in a conditionsType element. To preserve this order,
child elements must be kept in a list and cannot be separated into
type specific fields.

Either avoid restricting anyType, or write some type adapter, or
process the list.

-W


On Thu, Oct 9, 2008 at 11:09 AM, Lulseged Zerfu
<lulseged.zerfu_at_ericsson.com> wrote:
> Hi
>
> What is the benefit for jaxb when binding them to a single list? Can't
> this feature be available through custmozation if not default?
>
> It is very important that jaxb creates this classes which in turn makes
> it easier to go through and read values easly.
>
> Check out how the old CondtionsType and the new one looks like.
>
> Lulseged
>
> -----Original Message-----
> From: Wolfgang Laun [mailto:wolfgang.laun_at_gmail.com]
> Sent: den 6 oktober 2008 17:22
> To: users_at_jaxb.dev.java.net
> Subject: Re: no get and set methods generated
>
> An old xjc version (stamping the generated code with v2.0.2-b01-fcs from
> 2006) doesn't produce code from your type conditionsType that differs
> much from 2.1.8.
>
> The schema type says that a conditionsType element may have identity,
> sphere, validity and anything else as its children. The unmarshalled
> content tree is supposed to give you these subelements in the order they
> occur in the XML file.
> That's why
> JAXB binds them into a single list. You'll have to iterate over this
> list and test for the actual type.
>
> Other than this, you might consider writing a type adapter and override
> the default binding for conditionsType.
>
> -W
>
> On Mon, Oct 6, 2008 at 2:20 PM, Lulseged Zerfu
> <lulseged.zerfu_at_ericsson.com> wrote:
>> Hi
>>
>> When I used jaxb 2.1.3, I could easly pickup identity, sphere or
>> validty from a conditionstype but not since I started using jaxb
>> 2.1.8. I have to do a lot in my application to get this values.
>>
>> How can I generate so that I get a setX and getX methods. I want to
>> have getIdentity(), getSphere() and getValidity() methods in side
> ConditionsType.
>> Do I need a special binding?
>>
>> I have included a schema along with this e-mail.
>>
>> Lulseged
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>