[jboss-dev-forums] [Design of JBossXB] - Re: Attributes problem
adrian@jboss.org
do-not-reply at jboss.com
Fri Mar 7 06:16:20 EST 2008
"adrian at jboss.org" wrote :
| In the generic case (like the map's key/value) we don't have this option so we need
| to "synthesize it" during the parsing.
|
I guess an alternative would be to create more parsing artifacts,
something like:
| public class MapEntry
| {
| public Holder key;
| public Holder value;
| }
|
| @BeanAdapter(HolderAdapterFactroy.class)
| public class Holder
| {
| @XmlAttribute(name="replace")
| boolean replace;
|
| ValueMetaData value;
|
| @XmlValue
| public String string;
|
| //etc.
| }
|
Then write some code in HolderAdapter.getValue() that tries to figure out what to return
based on what to do based on what has been set.
But this isn't very declarative and is only usable in the MC's map context
rather than generically when others hit the same/similar problem.
It's also a lot more code to write and maintain. :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134814#4134814
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134814
More information about the jboss-dev-forums
mailing list