You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by jo...@apache.org on 2005/07/08 22:45:19 UTC

cvs commit: ws-jaxme/src/pm/org/apache/ws/jaxme/pm/generator/jdbc JaxMeJdbcSG.java

jochen      2005/07/08 13:45:19

  Modified:    src/jaxme/org/apache/ws/jaxme/generator/sg/impl Tag: v0_4
                        JAXBParticleSG.java JAXBComplexTypeSG.java
                        JAXBComplexContentTypeSG.java JAXBGroupSG.java
                        JAXBSchemaSG.java
               src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg Tag:
                        v0_4 GroupBeanSG.java GroupDriverSG.java
                        GroupHandlerSG.java
               .        Tag: v0_4 status.xml
               src/xs/org/apache/ws/jaxme/xs/junit Tag: v0_4
                        ParserTest.java
               src/jaxme/org/apache/ws/jaxme/junit Tag: v0_4
                        ParserTest.java
               src/jaxme/org/apache/ws/jaxme/generator/sg Tag: v0_4
                        ComplexContentSG.java
               src/test/jaxb Tag: v0_4 build.xml
               src/pm/org/apache/ws/jaxme/pm/generator/jdbc Tag: v0_4
                        JaxMeJdbcSG.java
  Log:
  Fixed that the generator didn't detect and refuse a complex type with a group of muliplicity > 1.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.8.2.1   +6 -7      ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBParticleSG.java
  
  Index: JAXBParticleSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBParticleSG.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- JAXBParticleSG.java	8 Apr 2005 23:10:46 -0000	1.8
  +++ JAXBParticleSG.java	8 Jul 2005 20:44:34 -0000	1.8.2.1
  @@ -49,24 +49,23 @@
   
       /** <p>Creates a new instance of JAXBParticleSG.java.</p>
        */
  -    public JAXBParticleSG(GroupSG pGroup, XSParticle pParticle, Context pClassContext) throws SAXException {
  -        minOccurs = pParticle.getMinOccurs();
  +    public JAXBParticleSG(SGFactory pFactory, XSParticle pParticle, Context pClassContext) throws SAXException {
  +    	minOccurs = pParticle.getMinOccurs();
           maxOccurs = pParticle.getMaxOccurs();
           type = pParticle.getType();
  -        SGFactory factory = pGroup.getFactory();
           if (pParticle.isGroup()) {
  -            groupSG = factory.getGroupSG(pParticle.getGroup(), pClassContext);
  +            groupSG = pFactory.getGroupSG(pParticle.getGroup(), pClassContext);
               objectSG = null;
   	    } else if (pParticle.isElement()) {
               element = pParticle.getElement();
               if (element.isGlobal()) {
  -                objectSG = factory.getObjectSG(element);
  +                objectSG = pFactory.getObjectSG(element);
               } else {
  -            	objectSG = factory.getObjectSG(element, pClassContext);
  +            	objectSG = pFactory.getObjectSG(element, pClassContext);
               }
   	        groupSG = null;
   	    } else if (pParticle.isWildcard()) {
  -	        objectSG = factory.getObjectSG(pParticle.getWildcard(), pClassContext);
  +	        objectSG = pFactory.getObjectSG(pParticle.getWildcard(), pClassContext);
   	        groupSG = null;
   	        wildcard = pParticle.getWildcard();
   	    } else {
  
  
  
  1.17.2.2  +3 -3      ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBComplexTypeSG.java
  
  Index: JAXBComplexTypeSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBComplexTypeSG.java,v
  retrieving revision 1.17.2.1
  retrieving revision 1.17.2.2
  diff -u -r1.17.2.1 -r1.17.2.2
  --- JAXBComplexTypeSG.java	4 Jul 2005 23:59:19 -0000	1.17.2.1
  +++ JAXBComplexTypeSG.java	8 Jul 2005 20:44:34 -0000	1.17.2.2
  @@ -222,7 +222,7 @@
   			if (ccSG.isEmpty()) {
   				return new EmptyElementBeanSG(pController, pJs);
   			} else {
  -				GroupSG group = ccSG.getGroupSG();
  +				GroupSG group = ccSG.getRootParticle().getGroupSG();
   				if (group.isAll()) {
   					return new AllBeanSG(pController, pJs);
   				} else if (group.isChoice()) {
  @@ -278,7 +278,7 @@
   			if (ccSG.isEmpty()) {
   				return new EmptyElementDriverSG(pController, pSource);
   			} else {
  -				GroupSG group = ccSG.getGroupSG();
  +				GroupSG group = ccSG.getRootParticle().getGroupSG();
   				if (group.isSequence()) {
   					return new SequenceDriverSG(pController, pSource);
   				} else if (group.isChoice()) {
  @@ -341,7 +341,7 @@
   			if (ccSG.isEmpty()) {
   				return new EmptyElementHandlerSG(pController, pJs);
   			} else {
  -				GroupSG group = ccSG.getGroupSG();
  +				GroupSG group = ccSG.getRootParticle().getGroupSG();
   				if (group.isSequence()) {
   					return new SequenceHandlerSG(pController, pJs);
   				} else if (group.isChoice()) {
  
  
  
  1.7.2.2   +18 -10    ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBComplexContentTypeSG.java
  
  Index: JAXBComplexContentTypeSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBComplexContentTypeSG.java,v
  retrieving revision 1.7.2.1
  retrieving revision 1.7.2.2
  diff -u -r1.7.2.1 -r1.7.2.2
  --- JAXBComplexContentTypeSG.java	29 Apr 2005 09:55:19 -0000	1.7.2.1
  +++ JAXBComplexContentTypeSG.java	8 Jul 2005 20:44:34 -0000	1.7.2.2
  @@ -21,14 +21,15 @@
   import org.apache.ws.jaxme.generator.sg.ComplexContentSG;
   import org.apache.ws.jaxme.generator.sg.ComplexContentSGChain;
   import org.apache.ws.jaxme.generator.sg.ComplexTypeSG;
  +import org.apache.ws.jaxme.generator.sg.Context;
   import org.apache.ws.jaxme.generator.sg.GroupSG;
   import org.apache.ws.jaxme.generator.sg.ObjectSG;
   import org.apache.ws.jaxme.generator.sg.ParticleSG;
   import org.apache.ws.jaxme.generator.sg.PropertySG;
  +import org.apache.ws.jaxme.generator.sg.SGFactory;
   import org.apache.ws.jaxme.js.JavaSource;
   import org.apache.ws.jaxme.logging.Logger;
   import org.apache.ws.jaxme.logging.LoggerAccess;
  -import org.apache.ws.jaxme.xs.XSGroup;
   import org.apache.ws.jaxme.xs.XSParticle;
   import org.apache.ws.jaxme.xs.XSType;
   import org.apache.ws.jaxme.xs.types.XSAnyType;
  @@ -63,8 +64,9 @@
               return anchestor;
           }
       }
  -    private final GroupSG groupSG;
  -	private final boolean isEmpty, isMixed;
  +
  +    private final boolean isEmpty, isMixed;
  +    private final ParticleSG rootParticle;
   
       private boolean isInitialized;
       private final Locator locator;
  @@ -81,17 +83,16 @@
   		}
   		locator = pType.getLocator();
   		if (pType.getComplexType().isEmpty()) {
  -			groupSG = null;
   			isEmpty = true;
   			isMixed = false;
  +			rootParticle = null;
   		} else {
   			XSParticle particle = pType.getComplexType().getParticle();
   			if (particle == null) {
   				throw new NullPointerException("Missing group particle for type = " + pType.getName());
   			}
   			if (particle.isGroup()) {
  -				XSGroup group = particle.getGroup();
  -				groupSG = pComplexTypeSG.getTypeSG().getFactory().getGroupSG(group, pComplexTypeSG.getClassContext());
  +				rootParticle = newParticleSG(pComplexTypeSG.getTypeSG().getFactory(), particle, pComplexTypeSG.getClassContext());
   			} else {
   				throw new IllegalStateException("Expected internal group");
   			}
  @@ -100,6 +101,13 @@
   		}
   	}
   
  +	protected ParticleSG newParticleSG(SGFactory pFactory, XSParticle pParticle, Context pContext) throws SAXException {
  +		JAXBParticleSG chain = new JAXBParticleSG(pFactory, pParticle, pContext);
  +		ParticleSGImpl result = new ParticleSGImpl(chain);
  +		result.init();
  +		return result;
  +	}
  +
       public Locator getLocator(ComplexContentSG pController) { return locator; }
   
   	public void init(ComplexContentSG pController) throws SAXException {
  @@ -131,8 +139,8 @@
   		return result;
   	}
   
  -	public GroupSG getGroupSG(ComplexContentSG pController) {
  -        return groupSG;
  +	public ParticleSG getRootParticle(ComplexContentSG pController) {
  +        return rootParticle;
   	}
   	
   	public boolean isEmpty(ComplexContentSG pController) {
  @@ -146,7 +154,7 @@
       
       private void findParticles(GroupSG[] pStack, ParticleSG pParticle) throws SAXException {
           if (pParticle.isGroup()) {
  -            if (pParticle.getMaxOccurs() > 1) {
  +            if (pParticle.isMultiple()) {
                   groupParticlesWithMultiplicityGreaterOne.add(new Particle(pStack, pParticle));
               } else {
                   findParticles(pParticle.getGroupSG());
  @@ -175,7 +183,7 @@
        * to the JAXB 1.0 specification, 5.9.7.
        */
       private void verify(ComplexContentSG pController) throws SAXException {
  -        findParticles(pController.getGroupSG());
  +        findParticles(new GroupSG[0], pController.getRootParticle());
   
           /* 5.9.7, 1) If {content type} is mixed, bind the entire content model
            * to a general content property with the content-property name "content".
  
  
  
  1.20.2.1  +1 -1      ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBGroupSG.java
  
  Index: JAXBGroupSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBGroupSG.java,v
  retrieving revision 1.20
  retrieving revision 1.20.2.1
  diff -u -r1.20 -r1.20.2.1
  --- JAXBGroupSG.java	14 Mar 2005 02:16:09 -0000	1.20
  +++ JAXBGroupSG.java	8 Jul 2005 20:44:34 -0000	1.20.2.1
  @@ -64,7 +64,7 @@
   	}
   	
   	public Object newParticleSG(GroupSG pController, XSParticle pParticle) throws SAXException {
  -		return new JAXBParticleSG(pController, pParticle, classContext);
  +		return new JAXBParticleSG(pController.getFactory(), pParticle, classContext);
   	}
   	
   	public Context getClassContext(GroupSG pController) { return classContext; }
  
  
  
  1.15.2.2  +28 -21    ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java
  
  Index: JAXBSchemaSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java,v
  retrieving revision 1.15.2.1
  retrieving revision 1.15.2.2
  diff -u -r1.15.2.1 -r1.15.2.2
  --- JAXBSchemaSG.java	19 Apr 2005 20:11:04 -0000	1.15.2.1
  +++ JAXBSchemaSG.java	8 Jul 2005 20:44:34 -0000	1.15.2.2
  @@ -524,31 +524,38 @@
   	  generateCreateMethods(pJs, pType, prefix, pContextSet);
     }
   
  +  /** Generate create methods for the given particle.
  +   */
  +  private void generateCreateMethods(JavaSource pJs, ParticleSG pParticle,
  +		  							String pName, Set pContextSet)
  +  		throws SAXException {
  +	  if (pParticle.isGroup()) {
  +		  GroupSG group = pParticle.getGroupSG();
  +		  generateCreateMethods(pJs, group.getParticles(), pName, pContextSet);
  +	  } else if (pParticle.isElement()) {
  +		  ObjectSG oSG = pParticle.getObjectSG();
  +		  if (oSG.isGlobal()) {
  +			  return;  // Will be generated elsewhere
  +		  }
  +		  TypeSG tSG = oSG.getTypeSG();
  +		  if (tSG.isGlobalType()) {
  +			  return;  // Will be generated elsewhere
  +		  }
  +		  generateCreateMethod(pJs, pContextSet, tSG, pName);
  +	  } else if (pParticle.isWildcard()) {
  +		  throw new IllegalStateException("TODO: Add support for wildcards here.");
  +	  } else {
  +		  throw new IllegalStateException("Invalid class type");
  +	  }
  +  }
  +
     /** Generate create methods for the given particles.
      */
     private void generateCreateMethods(JavaSource pJs, ParticleSG[] pParticles,
   		  							 String pName, Set pContextSet)
     		throws SAXException {
   	  for (int i = 0;  i < pParticles.length;  i++) {
  -		  ParticleSG particle = pParticles[i];
  -		  if (particle.isGroup()) {
  -			  GroupSG group = particle.getGroupSG();
  -			  generateCreateMethods(pJs, group.getParticles(), pName, pContextSet);
  -		  } else if (particle.isElement()) {
  -			  ObjectSG oSG = particle.getObjectSG();
  -			  if (oSG.isGlobal()) {
  -				  continue;  // Will be generated elsewhere
  -			  }
  -			  TypeSG tSG = oSG.getTypeSG();
  -			  if (tSG.isGlobalType()) {
  -				  continue;  // Will be generated elsewhere
  -			  }
  -			  generateCreateMethod(pJs, pContextSet, tSG, pName);
  -		  } else if (particle.isWildcard()) {
  -			  throw new IllegalStateException("TODO: Add support for wildcards here.");
  -		  } else {
  -			  throw new IllegalStateException("Invalid class type");
  -		  }
  +		  generateCreateMethods(pJs, pParticles[i], pName, pContextSet);
   	  }
     }
   
  @@ -565,8 +572,8 @@
   	  if (ccSG.isEmpty()) {
   		  return;
   	  }
  -	  GroupSG group = ccSG.getGroupSG();
  -	  generateCreateMethods(pJs, group.getParticles(), pName, pContextSet);
  +	  ParticleSG particle = ccSG.getRootParticle();
  +	  generateCreateMethods(pJs, particle, pName, pContextSet);
     }
   
     /**
  
  
  
  No                   revision
  No                   revision
  1.1.2.3   +1 -4      ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/Attic/GroupBeanSG.java
  
  Index: GroupBeanSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/Attic/GroupBeanSG.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- GroupBeanSG.java	5 Jul 2005 07:45:55 -0000	1.1.2.2
  +++ GroupBeanSG.java	8 Jul 2005 20:44:34 -0000	1.1.2.3
  @@ -6,9 +6,6 @@
   import org.apache.ws.jaxme.generator.sg.ObjectSG;
   import org.apache.ws.jaxme.generator.sg.ParticleSG;
   import org.apache.ws.jaxme.generator.sg.TypeSG;
  -import org.apache.ws.jaxme.generator.sg.impl.AllBeanSG;
  -import org.apache.ws.jaxme.generator.sg.impl.ChoiceBeanSG;
  -import org.apache.ws.jaxme.generator.sg.impl.SequenceBeanSG;
   import org.apache.ws.jaxme.js.JavaSource;
   import org.xml.sax.SAXException;
   
  @@ -24,7 +21,7 @@
   	protected GroupBeanSG(ComplexTypeSG pType, JavaSource pJs) throws SAXException {
   		super(pType, pJs);
   		ccSG = pType.getComplexContentSG();
  -		group = ccSG.getGroupSG();
  +		group = ccSG.getRootParticle().getGroupSG();
   		particles = group.getParticles();
   	}
   
  
  
  
  1.2.2.1   +1 -1      ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/Attic/GroupDriverSG.java
  
  Index: GroupDriverSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/Attic/GroupDriverSG.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- GroupDriverSG.java	8 Apr 2005 23:10:45 -0000	1.2
  +++ GroupDriverSG.java	8 Jul 2005 20:44:34 -0000	1.2.2.1
  @@ -51,7 +51,7 @@
   	protected GroupDriverSG(ComplexTypeSG pType, JavaSource pJs) throws SAXException {
   		super(pType, pJs);
   		ccSG = pType.getComplexContentSG();
  -		group = ccSG.getGroupSG();
  +		group = ccSG.getRootParticle().getGroupSG();
   		particles = group.getParticles();
   		if (pJs == null) {
   			throw new NullPointerException("The outer group must not be null.");
  
  
  
  1.4.2.2   +1 -2      ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/GroupHandlerSG.java
  
  Index: GroupHandlerSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/GroupHandlerSG.java,v
  retrieving revision 1.4.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- GroupHandlerSG.java	28 Apr 2005 23:57:40 -0000	1.4.2.1
  +++ GroupHandlerSG.java	8 Jul 2005 20:44:34 -0000	1.4.2.2
  @@ -38,7 +38,6 @@
   import org.apache.ws.jaxme.js.JavaSource;
   import org.apache.ws.jaxme.js.LocalJavaField;
   import org.apache.ws.jaxme.js.TypedValue;
  -import org.apache.ws.jaxme.js.impl.TypedValueImpl;
   import org.apache.ws.jaxme.xs.xml.XsQName;
   import org.xml.sax.SAXException;
   
  @@ -65,7 +64,7 @@
   	protected GroupHandlerSG(ComplexTypeSG pType, JavaSource pJs) throws SAXException {
   		super(pType, pJs);
   		ccSG = pType.getComplexContentSG();
  -		group = ccSG.getGroupSG();
  +		group = ccSG.getRootParticle().getGroupSG();
   		particles = group.getParticles();
   		findGroups(particles);
   	}
  
  
  
  No                   revision
  No                   revision
  1.45.2.13 +4 -0      ws-jaxme/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/status.xml,v
  retrieving revision 1.45.2.12
  retrieving revision 1.45.2.13
  diff -u -r1.45.2.12 -r1.45.2.13
  --- status.xml	8 Jul 2005 14:45:17 -0000	1.45.2.12
  +++ status.xml	8 Jul 2005 20:44:41 -0000	1.45.2.13
  @@ -43,6 +43,10 @@
           The JavaParser didn't handle multidimensional arrays
           properly. (Frederic Ahring, fahring@de.ibm.com)
         </action>
  +      <action dev="JW" type="fix" context="generator">
  +        Fixed that the generator didn't detect top level groups with
  +        multiplicity > 1 in a complex type.
  +      </action>
       </release>
       <release version="0.4" date="2005-May-19">
         <action dev="JW" type="fix" context="xs">
  
  
  
  No                   revision
  No                   revision
  1.20.2.6  +30 -0     ws-jaxme/src/xs/org/apache/ws/jaxme/xs/junit/ParserTest.java
  
  Index: ParserTest.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/xs/org/apache/ws/jaxme/xs/junit/ParserTest.java,v
  retrieving revision 1.20.2.5
  retrieving revision 1.20.2.6
  diff -u -r1.20.2.5 -r1.20.2.6
  --- ParserTest.java	5 Jul 2005 07:45:55 -0000	1.20.2.5
  +++ ParserTest.java	8 Jul 2005 20:44:48 -0000	1.20.2.6
  @@ -1456,4 +1456,34 @@
   		testRecursiveXsInclude(newXSParser());
   		testRecursiveXsInclude(newJAXBParser());
   	}
  +
  +	private void testGroupMultiplicity(XSParser pParser) throws Exception {
  +		final String schemaSource =
  +			"<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>\n"
  +			+ "<xs:element name='PARAMETERS'>\n"
  +			+ "  <xs:complexType>\n"
  +			+ "    <xs:choice maxOccurs='unbounded'>\n"
  +			+ "      <xs:element name='PARAMETER'/>\n"
  +			+ "      <xs:element name='SYSTEMPARAMETER'/>\n"
  +			+ "      <xs:element name='PREPREF'/>\n"
  +			+ "    </xs:choice>\n"
  +			+ "  </xs:complexType>\n"
  +			+ "</xs:element></xs:schema>\n";
  +        InputSource isource = new InputSource(new StringReader(schemaSource));
  +        isource.setSystemId("testElementReferenceGlobal.xsd");
  +        XSSchema schema = pParser.parse(isource);
  +        XSElement[] elements = schema.getElements();
  +        assertEquals(1, elements.length);
  +        XSElement parameters = elements[0];
  +        XSParticle particle = assertComplexContent(assertComplexType(parameters.getType()));
  +        assertEquals(1, particle.getMinOccurs());
  +        assertEquals(-1, particle.getMaxOccurs());
  +	}
  +
  +	/** Test the representation of groups with multiplicity > 1.
  +	 */
  +	public void testGroupMultiplicity() throws Exception {
  +		testGroupMultiplicity(newXSParser());
  +		testGroupMultiplicity(newJAXBParser());
  +	}
   }
  
  
  
  No                   revision
  No                   revision
  1.7.2.1   +9 -9      ws-jaxme/src/jaxme/org/apache/ws/jaxme/junit/ParserTest.java
  
  Index: ParserTest.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/junit/ParserTest.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- ParserTest.java	31 Dec 2004 00:41:06 -0000	1.7
  +++ ParserTest.java	8 Jul 2005 20:45:05 -0000	1.7.2.1
  @@ -338,7 +338,7 @@
       ComplexTypeSG ct3 = t3.getComplexTypeSG();
       assertTrue(!ct3.hasSimpleContent());
       ComplexContentSG cct3 = ct3.getComplexContentSG();
  -    ParticleSG[] childs = cct3.getGroupSG().getParticles();
  +    ParticleSG[] childs = cct3.getRootParticle().getGroupSG().getParticles();
       assertEquals(2, childs.length);
       assertTrue(childs[0].isElement());
       ObjectSG child1 = childs[0].getObjectSG();
  @@ -686,7 +686,7 @@
       assertEquals(new XsQName((String) null, "USAddress"), usAddress.getName());
       assertTrue(usAddress.isGlobalType());
       assertTrue(usAddress.isComplex());
  -    assertTrue(usAddress.getComplexTypeSG().getComplexContentSG().getGroupSG().isSequence());
  +    assertTrue(usAddress.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().isSequence());
       // USAddress.country
       //  <xsd:attribute name='country' type='xsd:string' fixed='US'/>
       // ToDo: test attribute fixed='US'
  @@ -697,7 +697,7 @@
       assertEquals(JavaQNameImpl.getInstance(String.class), country.getTypeSG().getRuntimeType());
       // USAddress children
       String [] nameShouldBe = {"name", "street", "city",  "state", "zip"};
  -    ParticleSG [] usAddressChildren = usAddress.getComplexTypeSG().getComplexContentSG().getGroupSG().getParticles();
  +    ParticleSG [] usAddressChildren = usAddress.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().getParticles();
       assertEquals(5, usAddressChildren.length);
       for (int i = 0; i < usAddressChildren.length; i++) {
         ParticleSG child = usAddressChildren[i];
  @@ -716,7 +716,7 @@
       ComplexTypeSG itemsComplex = items.getComplexTypeSG();
       assertTrue(!itemsComplex.hasSimpleContent());
       ComplexContentSG itemsComplexContent = itemsComplex.getComplexContentSG();
  -    GroupSG group = itemsComplexContent.getGroupSG();
  +    GroupSG group = itemsComplexContent.getRootParticle().getGroupSG();
       assertTrue(group.isSequence());
       // Items.item
       ParticleSG[] itemsChildren = group.getParticles();
  @@ -729,7 +729,7 @@
       TypeSG itemST = item.getObjectSG().getTypeSG();
       assertTrue(itemST.isComplex());
       assertTrue(!itemST.getComplexTypeSG().hasSimpleContent());
  -    assertTrue(itemST.getComplexTypeSG().getComplexContentSG().getGroupSG().isSequence());
  +    assertTrue(itemST.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().isSequence());
       // Items.item.partNum
       // <xsd:attribute name='partNum' type='SKU' use='required'/>
       AttributeSG[] itemAttributes = itemST.getComplexTypeSG().getAttributes();
  @@ -739,7 +739,7 @@
       assertTrue(partNum.isRequired());
       // Items.item.USPrice
       // <xsd:element name='USPrice'  type='xsd:decimal'/> 
  -    ParticleSG[] itemChildren = itemST.getComplexTypeSG().getComplexContentSG().getGroupSG().getParticles();
  +    ParticleSG[] itemChildren = itemST.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().getParticles();
       assertEquals(5, itemChildren.length);
       ParticleSG usPrice = itemChildren[2];
       assertTrue(usPrice.isElement());
  @@ -791,7 +791,7 @@
       assertEquals(new XsQName((String) null, "PurchaseOrderType"), purchaseOrderType.getName());
       assertTrue(purchaseOrderType.isGlobalType());
       assertTrue(purchaseOrderType.isComplex());
  -    assertTrue(purchaseOrderType.getComplexTypeSG().getComplexContentSG().getGroupSG().isSequence());
  +    assertTrue(purchaseOrderType.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().isSequence());
       // PurchaseOrderType.orderDate
       // <xsd:attribute name='orderDate' type='xsd:date'/>
       AttributeSG [] potAttributes = purchaseOrderType.getComplexTypeSG().getAttributes();
  @@ -800,7 +800,7 @@
       assertEquals(new XsQName((String) null, "orderDate"), orderDate.getName());
       assertEquals(JavaQNameImpl.getInstance(Calendar.class), 
                    orderDate.getTypeSG().getSimpleTypeSG().getRuntimeType());
  -    ParticleSG [] potChildren = purchaseOrderType.getComplexTypeSG().getComplexContentSG().getGroupSG().getParticles();
  +    ParticleSG [] potChildren = purchaseOrderType.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().getParticles();
       assertEquals(4, potChildren.length);
       // PurchaseOrderType.shipTo
       // <xsd:element name='shipTo' type='USAddress'/> 
  
  
  
  No                   revision
  No                   revision
  1.7.2.1   +3 -4      ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/ComplexContentSG.java
  
  Index: ComplexContentSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/ComplexContentSG.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- ComplexContentSG.java	6 Mar 2005 02:32:27 -0000	1.7
  +++ ComplexContentSG.java	8 Jul 2005 20:45:06 -0000	1.7.2.1
  @@ -15,11 +15,10 @@
    */
   package org.apache.ws.jaxme.generator.sg;
   
  +import org.apache.ws.jaxme.js.JavaSource;
   import org.xml.sax.Locator;
   import org.xml.sax.SAXException;
  -import org.apache.ws.jaxme.generator.sg.GroupSG;
   import org.apache.ws.jaxme.generator.sg.ParticleSG;
  -import org.apache.ws.jaxme.js.JavaSource;
   
   
   /** Interface of a complex type with a complex content model.
  @@ -41,9 +40,9 @@
   	 */
   	public boolean isMixed();
   	
  -	/** <p>Returns the child elements.</p>
  +	/** <p>Returns the types root particle.</p>
   	 */
  -	public GroupSG getGroupSG();
  +	public ParticleSG getRootParticle();
   
       /** Adds properties to the given source file.
        */
  
  
  
  No                   revision
  No                   revision
  1.17.2.1  +1 -1      ws-jaxme/src/test/jaxb/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/test/jaxb/build.xml,v
  retrieving revision 1.17
  retrieving revision 1.17.2.1
  diff -u -r1.17 -r1.17.2.1
  --- build.xml	6 Mar 2005 02:32:27 -0000	1.17
  +++ build.xml	8 Jul 2005 20:45:19 -0000	1.17.2.1
  @@ -120,7 +120,7 @@
         <schema dir="${basedir}">
           <include name="enumeration.xsd"/>
           <include name="wildcards.xsd"/>
  -        <include name="rss.xsd"/>
  +		<!--  <include name="rss.xsd"/>  -->
           <include name="**/xjc*.xsd"/> 
         </schema>
         <produces dir="${srcdir}" includes="org/apache/ws/jaxme/test/misc/enumeration/*"/>
  
  
  
  No                   revision
  No                   revision
  1.6.2.1   +1 -1      ws-jaxme/src/pm/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java
  
  Index: JaxMeJdbcSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/pm/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- JaxMeJdbcSG.java	3 Sep 2004 01:46:12 -0000	1.6
  +++ JaxMeJdbcSG.java	8 Jul 2005 20:45:19 -0000	1.6.2.1
  @@ -322,7 +322,7 @@
       }
       if (!pTypeSG.hasSimpleContent()) {
         ComplexContentSG cct = pTypeSG.getComplexContentSG();
  -      GroupSG groupSG = cct.getGroupSG();
  +      GroupSG groupSG = cct.getRootParticle().getGroupSG();
         ParticleSG[] childs = groupSG.getParticles();
         if (childs != null) {
           for (int i = 0;  i < childs.length;  i++) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org