Hi Vitali,
Vitali Nashkevich wrote:
> Hallo,
>
> Assume we have a xml fragment:
>
> **************************************
> <condition id="the-first"/>
> <condition id="the-second"/>
> <condition id="the-third"/>
> <if if-ref="the-first" then-ref="the-second" else-ref="the-third"/>
> ***************************************
>
> Obviously i want here to interpret attributes 'if-ref', 'then-ref' &
> 'else-ref' as references to previously defined objects.
> XStream.aliasSystemAttribute(...) allows just to redefine system
> attribute but does not allow to define several aliases
> for it.
>
> Custom converter does not help too because deserialised values are
> stored in private map
> of ReferenceByIdUnmarshaller(AbstractReferenceUnmarshaller) class.
>
> What could be the best solution for the problem?
References are handled by the Marshalling strategy implementation and
XStream's architecture is not prepared for such a use case. System
attributes are additionally meant to be unique constants.
For a solution you will have to implement your own MarshallingStrategy. You
may take he ReferencyById* classes and their abstract bases as template and
ajdust the code for your use case, but it is nothing XStream will support
out-of-the box.
Regards,
Jörg
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email