I'm back from travels (see the Javapolis conference at http://wiki.javapolis.com/ - my slide presentations are available from the slides page, and videos converted to flash files should be available sometime next month) and back to the mail stack. Sorry for the long-delayed reply on this one.

With the current code binding definitions are standalone files, so you can't do this. The beta 4 code includes a binding file <include> operation which allows you to use a composition approach.

- Dennis

[EMAIL PROTECTED] wrote:

Hello,
I'm worrying about how to use the jibx_bindings.txt declarations.

I'd hoped, that the '.txt' file approach (containing resources with bindings declarations)
would help JiBX (and me) to compose binding declarations for complex classes out of
the declarations for atomic classes.


For example:

public class Atom {
private String mValue;
}

has its binding definition in file pkg.atom_binding.xml
<binding>
<mapping name="Atom" ….>
<value name="value" field="mValue"/>
<mapping/>
</binding>

The following class has a collection of Atoms:

public class Container {
private List mAtoms = new ArrayList();
}

and of course ist binding definition pkg.container_binding.xml

<binding>
<mapping name="Container" ….>
<collection field="mAtoms" item-type="pkg.Atom"/>
<mapping/>
</binding>

Note that this declaration makes no assumptions about Atom representations/bindings.

Now I'd like to compose these two declarations in an jibx_bindings.txt file with the following content:
pkg.atom_binding.xml
pkg.container_binding.xml


in order to compose several binding declarations.
But this doesn't work for me.
I have to put the Atom <mapping> element into the Container binding file!

Does JiBx support these (composition) pattern/approach?

Regards
Jürgen Krey


-- Jürgen Krey _mailto:[EMAIL PROTECTED] sd&m AG software design & management Mülheimer Str. 9a, 53840 Troisdorf, Germany Tel +49 2241 9737-432, Fax -222



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to