[jboss-dev-forums] [Design the new POJO MicroContainer] - Imposed ordering of elements

kabir.khan@jboss.com do-not-reply at jboss.com
Mon Apr 13 07:21:14 EDT 2009


"alesj" wrote : 
  | We need to update MC-AOP-int's xmls:
  | - http://hudson.qa.jboss.com/hudson/job/AOP%20MC%20Integration%20-%20No%20Weave%20Tests/org.jboss.microcontainer$jboss-aop-mc-int/3451/
  | to follow the new strict order rules Alexey impounded.

The error for one of my tests is:

  | Caused by: org.jboss.xb.binding.JBossXBRuntimeException: {urn:jboss:aop-beans:1.0}class cannot appear in this posi
  | tion. Expected content of {urn:jboss:aop-beans:1.0}mixin is sequence: {urn:jboss:aop-beans:1.0}class? {urn:jboss:a
  | op-beans:1.0}construction? {urn:jboss:aop-beans:1.0}interfaces?
  |         at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:4
  | 94)
  | 
My schema is:

  |    <xsd:complexType name="mixinType">
  |       <xsd:annotation>
  |          <xsd:documentation>
  |             <![CDATA[
  |            A mixin within an interface introduction
  |            ]]>
  |          </xsd:documentation>
  |       </xsd:annotation>
  |       <xsd:all minOccurs="1" maxOccurs="1">
  |          <xsd:element name="interfaces" type="xsd:string" minOccurs="1" maxOccurs="1" />
  |          <xsd:element name="class" type="xsd:string" minOccurs="1" maxOccurs="1" />
  |          <xsd:element name="construction" type="xsd:string" minOccurs="0" maxOccurs="1" />
  |       </xsd:all>
  |       <xsd:attribute name="transient" type="xsd:boolean" use="optional"/>
  |    </xsd:complexType>
  | 
So I can only conclude that the order imposed is from the order of the setters in the associated parser class, which truly sucks:

  | public class MixinData
  | {
  |    String mixin;
  |    boolean isTransient = true;
  |    String construction;
  |    String interfaces;
  | 
  |    public boolean getTransient()
  |    {
  |       return isTransient;
  |    }
  | 
  |    @XmlAttribute
  |    public void setTransient(boolean isTransient)
  |    {
  |       this.isTransient = isTransient;
  |    }
  | 
  |    public String getMixin()
  |    {
  |       return mixin;
  |    }
  | 
  |    @XmlElement(name="class")
  |    public void setMixin(String mixin)
  |    {
  |       this.mixin = mixin;
  |    }
  | 
  |    public String getConstruction()
  |    {
  |       return construction;
  |    }
  | 
  |    public void setConstruction(String construction)
  |    {
  |       this.construction = construction;
  |    }
  | 
  |    public String getInterfaces()
  |    {
  |       return interfaces;
  |    }
  | 
  |    public void setInterfaces(String interfaces)
  |    {
  |       this.interfaces = interfaces;
  |    }   
  | }
  | 
Is there some annotation that can be used on the class to get rid of this imposed ordering?


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

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



More information about the jboss-dev-forums mailing list