[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 09:25:06 EDT 2008


"alex.loubyansky at jboss.com" wrote : adrian wrote : Maybe there should be some kind of @JBossXmlValue
  |   | annotation where we can say we want the empty string even for complex types.
  | 
  | This alone doesn't make sense to me. I.e. the property could always be initialized to an empty string and if there was actual data it would override it.
  | 

You could have the case (not this one) where you have a mixed
complex type and you want to know the value is ""

anonymous wrote : 
  | adrian wrote : 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?
  | 
  | Yes, I was thinking you needed this one.
  | 
  | An alternative could be a way to specify the default value (which in your case would be an empty string) in case there is no content.
  | 

Except in this case, we don't to apply the default when there are other elements.

Do you always have only one child? Or there could be more?

It's a mixed type with one optional child that is a choice from a group
(like I said before, the cdata and the valueGroup are really mutually
exclusive in our case, but you can't say that in xsd :-).


  |    <xsd:complexType name="valueType" mixed="true">
  | 
  |       <xsd:complexContent>
  | 
  |          <xsd:extension base="plainValueType">
  | 
  |             <xsd:sequence>
  | 
  |                <xsd:choice minOccurs="0">
  | 
  |                   <xsd:group ref="valueGroup"/>
  | 
  |                </xsd:choice>
  | 
  |             </xsd:sequence>
  | 
  |          </xsd:extension>
  | 
  |       </xsd:complexContent>
  | 
  |    </xsd:complexType>
  | 

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

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



More information about the jboss-dev-forums mailing list