Hi Steve,
in fact I know there is possible with abstract mapping but It's not
exactly the same thing I think.

In this way you are oblidged to use the mapping of Agency (by
<structure> element) inside another mapping, but in this way you
haven't assigned a name to this mapping.

So I think there isn't possible to assign to 2 different
mapping(global) the same class but with different element names.. (My
question was to find if this sentence is correct)

There are situation the way  of using abstract classes is good but if
I use a custom unmarshaller and I want to call the unmarshaller for
the 2 different elements I can't.


(I want to unmarshall <CompanyName>)
CompanyName company = (CompanyName)ctx.unmarshalElement();

---------------- NOT POSSIBLE
(I want to unmarshall <AgencyName> )
CompanyName agency= (CompanyName)ctx.unmarshalElement();

This is not possible for example because there isn't any mapping
definition for <AgencyName>

so the error is:
----> No unmarshaller for element "AgencyName"


Davide.

>You want to use abstract mappings: 
>http://jibx.sourceforge.net/tutorial/binding-mappings.html
>
>Something like
> <mapping class="CompanyName" abstract="true">
>    <value style="attribute" name="name" field="name"/>
>    <value style="attribute" name="code" field="code"/>
></mapping>
>
>Then the reference would be something like
>   <structure name="AgencyName" field="company"/>
>where "company" is an ivar of type CompanyName
>
>Steve

On Tue, 1 Jul 2008, gufux wrote:

>> Hi all,
>>
>> I've read in the archive that it's possible to define multiple <mapping> for 
>> the
>> same class with different element names *if* the direction of binding is 
>> *only*
>> input.
>> I've tried but there are errors and I think it's impossible....
>> [...]

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to