[Simple-support] Dynamic object type determination
Brought to you by:
niallg
|
From: Lumsdon, H. <Hug...@bl...> - 2011-06-03 17:57:15
|
Hi,
Very new to the Simple framework, but curious as to whether there is an
easy way to dynamically determine the object type that we're
de-serializing from the XML file itself without having to specify it in
advance as an argument to the Serializer. i.e. the object type would
be determined from the top-level XML element name.
Basically in many cases we're not expecting to have to manipulate
objects within our Java code - but purely pass them to a view (e.g.
Freemarker) so it can pull back specific bean properties using
introspection as normal. We're using Spring MVC - and it just means we
can use a generic controller in many circumtances to read in the
relevant content XML object and just hand off to the required view.
I guess this is a bit like the functionality the @Union annotation
provides, but that's obviously a level down so we'd have to wrap
everything. Maybe that is the best solution here, but just exploring
options.
Thanks.
THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE PRIVILEGED. If this message was misdirected, BlackRock, Inc. and its subsidiaries, ("BlackRock") does not waive any confidentiality or privilege. If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BlackRock, unless the author is authorized by BlackRock to express such views or opinions on its behalf. All email sent to or from this address is subject to electronic storage and review by BlackRock. Although BlackRock operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.
--
BlackRock Advisors (UK) Limited is authorized and regulated by The Financial Services Authority. Registered in England. Registered No:796793. Registered Office: 33 King William Street, London EC4R 9AS.
|