Hi Michael,
Michael Teixeira wrote:
> Thanks, yes, that seems to work. So basically the requirement is that two
> converters shouldn't run at the same priority - one should go ahead of
> another?
well, it's simply, that at conversion time all converters are asked to
convert this type in the reverse sequence they have been registered. The
first converter that returns "true" for canConvert is taken. This is fine,
since most converters handle distinct types.
However, some converters are more general e.g. ReflectionConverter,
SerializableConverter or JavaBeanConverter. Since it would be problematic to
add them again at the back of the registering chain, XStream supports a
priority at registering time. This priority will modify the registration
sequence by inserting the new converter before the first converter with same
or lower priority.
By default all converters are registered with normal prio, converters that
can handle multiple types in a generic way are usually using a low priority
and something like the ReflectionConverter use lowest prop, since it is
supposed to handle any type. It acts more or less as catch all.
Cheers,
Jörg
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email