[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: JBMICROCONT-336; empty string failure

adrian@jboss.org do-not-reply at jboss.com
Tue Aug 26 08:36:33 EDT 2008


"alex.loubyansky at jboss.com" wrote : In XB empty string processing is different for simple and complex types. I.e. for the following element
  | <e></e>
  | the result will be an empty string if e is of a simple type and null if e is of a complex type. It's null for the complex types because otherwise elements of complex types would always get non-null text data which was undesirable.

This is a complex type, but it is also "mixed", i.e. it can take a value.

Maybe there should be some kind of @JBossXmlValue
annotation where we can say we want the empty string even for complex types.

I'd suggest an element on the annotation where you say you don't want
the empty string data if there are child xml elements?

That is the rule for the mc's property element, but there's no way to say
that in an xml schema. ;-)

A workaround would be to create a subclass of AbstractPropertyMetaData
that initialises the value to an empty StringValueMetaData and then specify
that class on @XmlElement of the setProperties()


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172556#4172556

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172556



More information about the jboss-dev-forums mailing list