[jboss-dev-forums] [Design of JBossXB] - Issue with DescriptionGroup emement order and older descript

scott.stark@jboss.org do-not-reply at jboss.com
Thu Oct 11 09:58:03 EDT 2007


The org.jboss.test.metadata.web.WebApp23UnitTestCase.testVersion is failing in the jboss-metadata project due to how the javaee description group is a seqence of description, display-names, icons:


  | @JBossXmlModelGroup(name="descriptionGroup", propOrder={"descriptions", "displayNames", "icons"})
  | public class DescriptionGroupMetaData implements Serializable
  | 

The issue is that when a web.xml that conforms to a web-app_2_3.dtd, which has a different order for these:

  | <!ELEMENT web-app (icon?, display-name?, description?, ...>
  | 

3 different description groups end up being created, with each one only having a single property set. What is the best way to a override this behavior in the org.jboss.metadata.web.spec.Web23MetaData?

Note that this is a problem for a 2.5 web.xml as well since the WebAppMetaData base class only declares a single valued DescriptionGroupMetaData property. Only the last set of in order elements shows up on the 

One way to fix this would be to make this a List of DescriptionGroupMetaData, and have the simple getIcon()/getDescription()/getDisplayName() accessors look over all DescriptionGroupMetaData for the first non-null result.

To keep a single DescriptionGroupMetaData, it needs to be declared as a sequence of choices of the icon, display-name, description elements.


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

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



More information about the jboss-dev-forums mailing list