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 2006/08/31 14:29:42 UTC

svn commit: r438889 - in /webservices/jaxme/branches: MAVEN/ MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/ MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/ MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/ge...

Author: jochen
Date: Thu Aug 31 05:29:41 2006
New Revision: 438889

URL: http://svn.apache.org/viewvc?rev=438889&view=rev
Log:
The element jaxb:property/jaxb:baseType/jaxb:javaType wasn't honured.

Removed:
    webservices/jaxme/branches/MAVEN/projects/jm/src/test/resources/bindings/bindings.jxb
Modified:
    webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/SGFactory.java
    webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBAttributeSG.java
    webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java
    webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSGFactory.java
    webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java
    webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSimpleContentTypeSG.java
    webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java
    webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/types/ListTypeSGImpl.java
    webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/types/UnionTypeSGImpl.java
    webservices/jaxme/branches/MAVEN/projects/jm/src/test/java/org/apache/ws/jaxme/junit/BindingsTest.java
    webservices/jaxme/branches/MAVEN/projects/pm/src/main/java/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java
    webservices/jaxme/branches/MAVEN/status.xml
    webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/SGFactory.java
    webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBAttributeSG.java
    webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java
    webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSGFactory.java
    webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java
    webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSimpleContentTypeSG.java
    webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java
    webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/ListTypeSGImpl.java
    webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/UnionTypeSGImpl.java
    webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/junit/BindingsTest.java
    webservices/jaxme/branches/b0_5/src/pm/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java
    webservices/jaxme/branches/b0_5/src/test/jaxb/bindings/bindings.jxb
    webservices/jaxme/branches/b0_5/src/test/jaxb/bindings/bindings.xsd
    webservices/jaxme/branches/b0_5/status.xml

Modified: webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/SGFactory.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/SGFactory.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/SGFactory.java (original)
+++ webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/SGFactory.java Thu Aug 31 05:29:41 2006
@@ -25,6 +25,7 @@
 import org.apache.ws.jaxme.xs.XSParser;
 import org.apache.ws.jaxme.xs.XSSchema;
 import org.apache.ws.jaxme.xs.XSType;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
 import org.apache.ws.jaxme.xs.xml.XsObjectFactory;
 import org.apache.ws.jaxme.xs.xml.XsQName;
 import org.apache.ws.jaxme.generator.sg.Context;
@@ -136,12 +137,12 @@
    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
    * interface.</p>
    */
-  public Object newTypeSG(XSType pType) throws SAXException;
+  public Object newTypeSG(XSType pType, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Returns a global instance of {@link TypeSG} generating
    * the given type.</p>
    */
-  public TypeSG getTypeSG(XSType pType) throws SAXException;
+  public TypeSG getTypeSG(XSType pType, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Creates a new, local instance of
    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain},
@@ -154,12 +155,12 @@
    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
    * interface.</p>
    */
-  public Object newTypeSG(XSType pType, Context pClassContext, XsQName pName) throws SAXException;
+  public Object newTypeSG(XSType pType, Context pClassContext, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Returns a local instance of {@link TypeSG} generating
    * the given type within the given {@link Context}.</p>
    */
-  public TypeSG getTypeSG(XSType pType, Context pClassContext, XsQName pName) throws SAXException;
+  public TypeSG getTypeSG(XSType pType, Context pClassContext, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Creates a new, local instance of
    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain},
@@ -172,13 +173,13 @@
    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
    * interface.</p>
    */
-  public Object newTypeSG(XSType pType, XsQName pName) throws SAXException;
+  public Object newTypeSG(XSType pType, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Returns a new instance of {@link TypeSG} generating
    * the given type, as if it were a global type with the
    * given name.</p>
    */
-  public TypeSG getTypeSG(XSType pType, XsQName pName) throws SAXException;
+  public TypeSG getTypeSG(XSType pType, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Creates a new instance of {@link XSParser}.</p>
    */

Modified: webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBAttributeSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBAttributeSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBAttributeSG.java (original)
+++ webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBAttributeSG.java Thu Aug 31 05:29:41 2006
@@ -30,6 +30,8 @@
 import org.apache.ws.jaxme.xs.XSAttribute;
 import org.apache.ws.jaxme.xs.XSType;
 import org.apache.ws.jaxme.xs.XSWildcard;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
+import org.apache.ws.jaxme.xs.jaxb.JAXBPropertyOwner;
 import org.apache.ws.jaxme.xs.xml.XsNamespaceList;
 import org.apache.ws.jaxme.xs.xml.XsQName;
 import org.apache.ws.jaxme.xs.xml.XsTWildcard;
@@ -62,13 +64,22 @@
         if (type == null) {
             throw new IllegalStateException("The attribute type must not be null.");
         }
+
+        final JAXBProperty.BaseType baseType;
+        if (pAttribute instanceof JAXBPropertyOwner) {
+        	JAXBProperty property = ((JAXBPropertyOwner) pAttribute).getJAXBProperty();
+        	baseType = property == null ? null : property.getBaseType();
+        } else {
+        	baseType = null;
+        }
+
         if (type.isGlobal()) {
-        	typeSG = getFactory().getTypeSG(type);
+        	typeSG = getFactory().getTypeSG(type, baseType);
             if (typeSG == null) {
             	throw new IllegalStateException("Unknown global type: " + type.getName());
             }
         } else {
-        	typeSG = getFactory().getTypeSG(pAttribute.getType(), pClassContext, name);
+        	typeSG = getFactory().getTypeSG(pAttribute.getType(), pClassContext, name, baseType);
         }
 		isWildcard = false;
 		namespaceList = null;
@@ -113,7 +124,7 @@
 	public SchemaSG getSchema(AttributeSG pController) { return getSchema(); }
 	public Locator getLocator(AttributeSG pController) { return getLocator(); }
 	public XsQName getName(AttributeSG pController) { return name; }
-	
+
 	public boolean isRequired(AttributeSG pAttrController) { return isRequired; }
 	
 	public void forAllValues(AttributeSG pController, JavaMethod pMethod,

Modified: webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java (original)
+++ webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java Thu Aug 31 05:29:41 2006
@@ -37,8 +37,9 @@
 import org.apache.ws.jaxme.xs.XSAttribute;
 import org.apache.ws.jaxme.xs.XSElement;
 import org.apache.ws.jaxme.xs.XSObject;
-import org.apache.ws.jaxme.xs.XSSimpleContentType;
 import org.apache.ws.jaxme.xs.XSType;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
+import org.apache.ws.jaxme.xs.jaxb.JAXBPropertyOwner;
 import org.apache.ws.jaxme.xs.xml.XsQName;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -112,14 +113,22 @@
       myClassContext = new GlobalContext(name, contextObject, null, null, pSchema);
     }
 
+    final JAXBProperty.BaseType baseType;
+    if (pObject instanceof JAXBPropertyOwner) {
+    	JAXBProperty property = ((JAXBPropertyOwner) pObject).getJAXBProperty();
+    	baseType = property == null ? null : property.getBaseType();
+    } else {
+    	baseType = null;
+    }
+
     if (isClassGlobal) {
       if (type.isGlobal()) {
-        typeSG = pFactory.getTypeSG(type);
+        typeSG = pFactory.getTypeSG(type, baseType);
       } else {
-        typeSG = pFactory.getTypeSG(type, myClassContext.getName());
+        typeSG = pFactory.getTypeSG(type, myClassContext.getName(), baseType);
       }
     } else {
-      typeSG = pFactory.getTypeSG(type, myClassContext, name);
+      typeSG = pFactory.getTypeSG(type, myClassContext, name, baseType);
     }
 
     if (useTypesContext) {
@@ -139,20 +148,6 @@
       classContext = null;
     }
     log.finest(mName, "<-", new Object[]{typeSG, classContext});
-  }
-
-  /** <p>Creates a new instance of JAXBObjectSG generating the given simple
-   * content <code>pContent</code> of the given complex type
-   * <code>pComplexType</code>.</p>
-   */
-  public JAXBObjectSG(SGFactory pFactory, SchemaSG pSchema, TypeSG pComplexType,
-                       XSSimpleContentType pContainer, XSType pType) throws SAXException {
-    super(pFactory, pSchema, pType);
-    global = false;
-    type = pType;
-    name = null;
-    classContext = pComplexType.getComplexTypeSG().getClassContext();
-    typeSG = pFactory.getTypeSG(type, classContext, null);
   }
 
   /** <p>Creates a new instance of JAXBObjectSG generating the given

Modified: webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSGFactory.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSGFactory.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSGFactory.java (original)
+++ webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSGFactory.java Thu Aug 31 05:29:41 2006
@@ -47,6 +47,7 @@
 import org.apache.ws.jaxme.xs.XSParser;
 import org.apache.ws.jaxme.xs.XSSchema;
 import org.apache.ws.jaxme.xs.XSType;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
 import org.apache.ws.jaxme.xs.jaxb.impl.JAXBObjectFactoryImpl;
 import org.apache.ws.jaxme.xs.jaxb.impl.JAXBParser;
 import org.apache.ws.jaxme.xs.jaxb.impl.JAXBXsObjectFactoryImpl;
@@ -187,12 +188,12 @@
 		return new JAXBSchemaSG(pController, pSchema);
 	}
 	
-	public TypeSG getTypeSG(SGFactory pController, XSType pType) throws SAXException {
+	public TypeSG getTypeSG(SGFactory pController, XSType pType, JAXBProperty.BaseType pBaseType) throws SAXException {
 		final String mName = "getTypeSG(XSType)";
 		TypeSG result = (TypeSG) types.get(pType);
 		if (result == null) {
 			log.finest(mName, "->", pType.getName());
-			TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType);
+			TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType, pBaseType);
 			result = new TypeSGImpl(chain);
 			types.put(pType, result);
 			typesByOrder.add(result);
@@ -202,17 +203,17 @@
 		return result;
 	}
 	
-	public Object newTypeSG(SGFactory pController, XSType pType) throws SAXException {
+	public Object newTypeSG(SGFactory pController, XSType pType, JAXBProperty.BaseType pBaseType) throws SAXException {
 		if (schemaSG == null) {
 			throw new IllegalStateException("A schema has not yet been created");
 		}
-		return new JAXBTypeSG(pController, schemaSG, pType);
+		return new JAXBTypeSG(pController, schemaSG, pType, pBaseType);
 	}
 	
-	public TypeSG getTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName) throws SAXException {
+	public TypeSG getTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException {
 		final String mName = "getTypeSG(XSType,ClassContext)";
 		log.finest(mName, "->", new Object[]{pType, pClassContext});
-        TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType, pClassContext, pName);
+        TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType, pClassContext, pName, pBaseType);
 		TypeSG result = new TypeSGImpl(chain);
 		typesByOrder.add(result);
 		result.init();
@@ -220,22 +221,24 @@
 		return result;
 	}
 	
-	public Object newTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName) throws SAXException {
+	public Object newTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName,
+			JAXBProperty.BaseType pBaseType) throws SAXException {
 		if (schemaSG == null) {
 			throw new IllegalStateException("A schema has not yet been created");
 		}
-		return new JAXBTypeSG(pController, schemaSG, pType, pClassContext, pName);
+		return new JAXBTypeSG(pController, schemaSG, pType, pClassContext, pName, pBaseType);
 	}
 	
-	public Object newTypeSG(SGFactory pController, XSType pType, XsQName pName) throws SAXException {
+	public Object newTypeSG(SGFactory pController, XSType pType, XsQName pName,
+			JAXBProperty.BaseType pBaseType) throws SAXException {
 		if (schemaSG == null) {
 			throw new IllegalStateException("A schema has not yet been created");
 		}
-		return new JAXBTypeSG(pController, schemaSG, pType, pName);
+		return new JAXBTypeSG(pController, schemaSG, pType, pName, pBaseType);
 	}
 	
-	public TypeSG getTypeSG(SGFactory pController, XSType pType, XsQName pName) throws SAXException {
-		TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType, pName);
+	public TypeSG getTypeSG(SGFactory pController, XSType pType, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException {
+		TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType, pName, pBaseType);
 		TypeSG result = new TypeSGImpl(chain);
 		typesByOrder.add(result);
 		result.init();

Modified: webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java (original)
+++ webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java Thu Aug 31 05:29:41 2006
@@ -157,7 +157,7 @@
     if (type == null) {
       return null;
     }
-    typeSG = pController.getFactory().getTypeSG(type);
+    typeSG = pController.getFactory().getTypeSG(type, null);
     typesByName.put(pName, typeSG);
     return typeSG;
   }

Modified: webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSimpleContentTypeSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSimpleContentTypeSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSimpleContentTypeSG.java (original)
+++ webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBSimpleContentTypeSG.java Thu Aug 31 05:29:41 2006
@@ -40,7 +40,7 @@
     xsType = pType;
     typeSG = pComplexTypeSG.getTypeSG();
     XSType theSimpleType = pType.getComplexType().getSimpleContent().getType();
-    contentTypeSG = typeSG.getFactory().getTypeSG(theSimpleType, pComplexTypeSG.getClassContext(), null);
+    contentTypeSG = typeSG.getFactory().getTypeSG(theSimpleType, pComplexTypeSG.getClassContext(), null, null);
   }
 
   public Object newPropertySGChain(SimpleContentSG pController) throws SAXException {

Modified: webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java (original)
+++ webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java Thu Aug 31 05:29:41 2006
@@ -67,6 +67,7 @@
 import org.apache.ws.jaxme.xs.jaxb.JAXBEnumeration;
 import org.apache.ws.jaxme.xs.jaxb.JAXBGlobalBindings;
 import org.apache.ws.jaxme.xs.jaxb.JAXBJavaType;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
 import org.apache.ws.jaxme.xs.jaxb.JAXBSchema;
 import org.apache.ws.jaxme.xs.jaxb.JAXBSchemaBindings;
 import org.apache.ws.jaxme.xs.jaxb.JAXBSimpleType;
@@ -135,17 +136,19 @@
   private final XsQName name;
   private Map properties;
   private final XsSchemaHeader schemaHeader;
+  private final JAXBProperty.BaseType baseType;
 
   /** <p>Creates a new, global instance of JAXBTypeSG.</p>
    */
-  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType)
+  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType, JAXBProperty.BaseType pBaseType)
       throws SAXException {
-    this(pFactory, pSchema, pType, null, pType.getName());
+    this(pFactory, pSchema, pType, null, pType.getName(), pBaseType);
     isGlobalClass = true;
   }
 
-  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType, XsQName pName) throws SAXException {
-    this(pFactory, pSchema, pType, null, pName);
+  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType, XsQName pName,
+		  JAXBProperty.BaseType pBaseType) throws SAXException {
+    this(pFactory, pSchema, pType, null, pName, pBaseType);
     isGlobalClass = true;
   }
 
@@ -155,7 +158,7 @@
       XsQName name = pReferencedType.getName();
       TypeSG result;
       if (pReferencedType.isGlobal()) {
-      	  result = pFactory.getTypeSG(pReferencedType);
+      	  result = pFactory.getTypeSG(pReferencedType, null);
       	  if (result == null) {
       	  	  throw new SAXParseException("Unknown global type " + name,
       	  	  		                      pReferencingType.getLocator());
@@ -169,9 +172,11 @@
   /** <p>Creates a new, local instance of JAXBTypeSG. Classes are generated
    * into the given context.</p>
    */
-  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType, Context pClassContext, XsQName pName)
+  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType, Context pClassContext, XsQName pName,
+		  JAXBProperty.BaseType pBaseType)
       throws SAXException {
     super(pFactory, pSchema, pType);
+    baseType = pBaseType;
     name = pName;
     xsType = pType;
     if (pType.isSimple()) {
@@ -628,6 +633,9 @@
 
   private JAXBJavaType findJavaType(SchemaSG pSchema, XSType pType)
       throws SAXException {
+	if (baseType != null  &&  baseType.getJavaType() != null) {
+		return baseType.getJavaType();
+	}
     JAXBJavaType[] globalJavaTypes = pSchema.getJAXBJavaTypes();
     
     for (XSType currentType = pType;  currentType != null;  ) {

Modified: webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/types/ListTypeSGImpl.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/types/ListTypeSGImpl.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/types/ListTypeSGImpl.java (original)
+++ webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/types/ListTypeSGImpl.java Thu Aug 31 05:29:41 2006
@@ -83,7 +83,7 @@
   }
 
   public void init(SimpleTypeSG pController) throws SAXException {
-    itemType = getFactory().getTypeSG(listType.getItemType(), classContext, name);
+    itemType = getFactory().getTypeSG(listType.getItemType(), classContext, name, null);
   }
 
   protected TypeSG getItemType() {

Modified: webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/types/UnionTypeSGImpl.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/types/UnionTypeSGImpl.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/types/UnionTypeSGImpl.java (original)
+++ webservices/jaxme/branches/MAVEN/projects/jm/src/main/java/org/apache/ws/jaxme/generator/types/UnionTypeSGImpl.java Thu Aug 31 05:29:41 2006
@@ -57,7 +57,7 @@
     XSType[] mTypes = unionType.getMemberTypes();
     List members = new ArrayList();
     for (int i = 0;  i < mTypes.length;  i++) {
-      TypeSG typeSG = getFactory().getTypeSG(mTypes[i], pClassContext, pName);
+      TypeSG typeSG = getFactory().getTypeSG(mTypes[i], pClassContext, pName, null);
       typeSG.getSimpleTypeSG().setNullable(true);
       members.add(typeSG);
     }

Modified: webservices/jaxme/branches/MAVEN/projects/jm/src/test/java/org/apache/ws/jaxme/junit/BindingsTest.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/projects/jm/src/test/java/org/apache/ws/jaxme/junit/BindingsTest.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/projects/jm/src/test/java/org/apache/ws/jaxme/junit/BindingsTest.java (original)
+++ webservices/jaxme/branches/MAVEN/projects/jm/src/test/java/org/apache/ws/jaxme/junit/BindingsTest.java Thu Aug 31 05:29:41 2006
@@ -55,6 +55,7 @@
 	public void testBindings() throws Exception {
 		FooType foo = new ObjectFactory().createFoo();
 		foo.setBar(YesNoTypeClass.YES);
+		foo.setBool(Boolean.TRUE);
 		ImpFooType impFoo = new org.apache.ws.jaxme.test.bindings.imported.vo.ObjectFactory().createImpFoo();
 		impFoo.setXyz(org.apache.ws.jaxme.test.bindings.imported.vo.YesNoTypeClass.NO);
 	}

Modified: webservices/jaxme/branches/MAVEN/projects/pm/src/main/java/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/projects/pm/src/main/java/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/projects/pm/src/main/java/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java (original)
+++ webservices/jaxme/branches/MAVEN/projects/pm/src/main/java/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java Thu Aug 31 05:29:41 2006
@@ -56,6 +56,7 @@
 import org.apache.ws.jaxme.xs.XSObject;
 import org.apache.ws.jaxme.xs.XSSchema;
 import org.apache.ws.jaxme.xs.XSType;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
 import org.apache.ws.jaxme.xs.parser.XsObjectCreator;
 import org.apache.ws.jaxme.xs.parser.impl.LocSAXException;
 import org.apache.ws.jaxme.xs.types.XSBase64Binary;
@@ -544,16 +545,16 @@
     }
   }
 
-  public Object newTypeSG(SGFactory pController, XSType pType) throws SAXException {
-    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType), pType);
+  public Object newTypeSG(SGFactory pController, XSType pType, JAXBProperty.BaseType pBaseType) throws SAXException {
+    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType, pBaseType), pType);
   }
 
-  public Object newTypeSG(SGFactory pController, XSType pType, XsQName pName) throws SAXException {
-    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType, pName), pType);
+  public Object newTypeSG(SGFactory pController, XSType pType, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException {
+    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType, pName, pBaseType), pType);
   }
 
-  public Object newTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName) throws SAXException {
-    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType, pClassContext, pName), pType);
+  public Object newTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException {
+    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType, pClassContext, pName, pBaseType), pType);
   }
 
   public Object newSchemaSG(SGFactory pController, XSSchema pSchema) throws SAXException {

Modified: webservices/jaxme/branches/MAVEN/status.xml
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/MAVEN/status.xml?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/MAVEN/status.xml (original)
+++ webservices/jaxme/branches/MAVEN/status.xml Thu Aug 31 05:29:41 2006
@@ -67,6 +67,9 @@
       <action dev="JW" type="fix" context="generator">
         The jaxb:class customization wasn't honoured by anonymous types.
       </action>
+      <action dev="JW" type="fix" context="generator">
+        The element jaxb:property/jaxb:baseType/jaxb:javaType wasn't honured.
+      </action>
     </release>
 	<release version="0.5.1" date="Not yet published">
       <action dev="JW" type="enhancement" context="js">

Modified: webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/SGFactory.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/SGFactory.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/SGFactory.java (original)
+++ webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/SGFactory.java Thu Aug 31 05:29:41 2006
@@ -25,6 +25,7 @@
 import org.apache.ws.jaxme.xs.XSParser;
 import org.apache.ws.jaxme.xs.XSSchema;
 import org.apache.ws.jaxme.xs.XSType;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
 import org.apache.ws.jaxme.xs.xml.XsObjectFactory;
 import org.apache.ws.jaxme.xs.xml.XsQName;
 import org.apache.ws.jaxme.generator.sg.Context;
@@ -136,12 +137,12 @@
    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
    * interface.</p>
    */
-  public Object newTypeSG(XSType pType) throws SAXException;
+  public Object newTypeSG(XSType pType, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Returns a global instance of {@link TypeSG} generating
    * the given type.</p>
    */
-  public TypeSG getTypeSG(XSType pType) throws SAXException;
+  public TypeSG getTypeSG(XSType pType, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Creates a new, local instance of
    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain},
@@ -154,12 +155,12 @@
    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
    * interface.</p>
    */
-  public Object newTypeSG(XSType pType, Context pClassContext, XsQName pName) throws SAXException;
+  public Object newTypeSG(XSType pType, Context pClassContext, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Returns a local instance of {@link TypeSG} generating
    * the given type within the given {@link Context}.</p>
    */
-  public TypeSG getTypeSG(XSType pType, Context pClassContext, XsQName pName) throws SAXException;
+  public TypeSG getTypeSG(XSType pType, Context pClassContext, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Creates a new, local instance of
    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain},
@@ -172,13 +173,13 @@
    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
    * interface.</p>
    */
-  public Object newTypeSG(XSType pType, XsQName pName) throws SAXException;
+  public Object newTypeSG(XSType pType, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Returns a new instance of {@link TypeSG} generating
    * the given type, as if it were a global type with the
    * given name.</p>
    */
-  public TypeSG getTypeSG(XSType pType, XsQName pName) throws SAXException;
+  public TypeSG getTypeSG(XSType pType, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException;
 
   /** <p>Creates a new instance of {@link XSParser}.</p>
    */

Modified: webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBAttributeSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBAttributeSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBAttributeSG.java (original)
+++ webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBAttributeSG.java Thu Aug 31 05:29:41 2006
@@ -30,6 +30,8 @@
 import org.apache.ws.jaxme.xs.XSAttribute;
 import org.apache.ws.jaxme.xs.XSType;
 import org.apache.ws.jaxme.xs.XSWildcard;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
+import org.apache.ws.jaxme.xs.jaxb.JAXBPropertyOwner;
 import org.apache.ws.jaxme.xs.xml.XsNamespaceList;
 import org.apache.ws.jaxme.xs.xml.XsQName;
 import org.apache.ws.jaxme.xs.xml.XsTWildcard;
@@ -62,13 +64,22 @@
         if (type == null) {
             throw new IllegalStateException("The attribute type must not be null.");
         }
+
+        final JAXBProperty.BaseType baseType;
+        if (pAttribute instanceof JAXBPropertyOwner) {
+        	JAXBProperty property = ((JAXBPropertyOwner) pAttribute).getJAXBProperty();
+        	baseType = property == null ? null : property.getBaseType();
+        } else {
+        	baseType = null;
+        }
+
         if (type.isGlobal()) {
-        	typeSG = getFactory().getTypeSG(type);
+        	typeSG = getFactory().getTypeSG(type, baseType);
             if (typeSG == null) {
             	throw new IllegalStateException("Unknown global type: " + type.getName());
             }
         } else {
-        	typeSG = getFactory().getTypeSG(pAttribute.getType(), pClassContext, name);
+        	typeSG = getFactory().getTypeSG(pAttribute.getType(), pClassContext, name, baseType);
         }
 		isWildcard = false;
 		namespaceList = null;
@@ -113,7 +124,7 @@
 	public SchemaSG getSchema(AttributeSG pController) { return getSchema(); }
 	public Locator getLocator(AttributeSG pController) { return getLocator(); }
 	public XsQName getName(AttributeSG pController) { return name; }
-	
+
 	public boolean isRequired(AttributeSG pAttrController) { return isRequired; }
 	
 	public void forAllValues(AttributeSG pController, JavaMethod pMethod,

Modified: webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java (original)
+++ webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java Thu Aug 31 05:29:41 2006
@@ -39,6 +39,8 @@
 import org.apache.ws.jaxme.xs.XSObject;
 import org.apache.ws.jaxme.xs.XSSimpleContentType;
 import org.apache.ws.jaxme.xs.XSType;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
+import org.apache.ws.jaxme.xs.jaxb.JAXBPropertyOwner;
 import org.apache.ws.jaxme.xs.xml.XsQName;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -112,14 +114,22 @@
     	myClassContext = new GlobalContext(name, contextObject, null, null, pSchema);
     }
 
+    final JAXBProperty.BaseType baseType;
+    if (pObject instanceof JAXBPropertyOwner) {
+    	JAXBProperty property = ((JAXBPropertyOwner) pObject).getJAXBProperty();
+    	baseType = property == null ? null : property.getBaseType();
+    } else {
+    	baseType = null;
+    }
+    
     if (isClassGlobal) {
       if (type.isGlobal()) {
-        typeSG = pFactory.getTypeSG(type);
+        typeSG = pFactory.getTypeSG(type, baseType);
       } else {
-        typeSG = pFactory.getTypeSG(type, myClassContext.getName());
+        typeSG = pFactory.getTypeSG(type, myClassContext.getName(), baseType);
       }
     } else {
-      typeSG = pFactory.getTypeSG(type, myClassContext, name);
+      typeSG = pFactory.getTypeSG(type, myClassContext, name, baseType);
     }
 
     if (useTypesContext) {
@@ -139,20 +149,6 @@
       classContext = null;
     }
     log.finest(mName, "<-", new Object[]{typeSG, classContext});
-  }
-
-  /** <p>Creates a new instance of JAXBObjectSG generating the given simple
-   * content <code>pContent</code> of the given complex type
-   * <code>pComplexType</code>.</p>
-   */
-  public JAXBObjectSG(SGFactory pFactory, SchemaSG pSchema, TypeSG pComplexType,
-                       XSSimpleContentType pContainer, XSType pType) throws SAXException {
-    super(pFactory, pSchema, pType);
-    global = false;
-    type = pType;
-    name = null;
-    classContext = pComplexType.getComplexTypeSG().getClassContext();
-    typeSG = pFactory.getTypeSG(type, classContext, null);
   }
 
   /** <p>Creates a new instance of JAXBObjectSG generating the given

Modified: webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSGFactory.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSGFactory.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSGFactory.java (original)
+++ webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSGFactory.java Thu Aug 31 05:29:41 2006
@@ -47,6 +47,7 @@
 import org.apache.ws.jaxme.xs.XSParser;
 import org.apache.ws.jaxme.xs.XSSchema;
 import org.apache.ws.jaxme.xs.XSType;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
 import org.apache.ws.jaxme.xs.jaxb.impl.JAXBObjectFactoryImpl;
 import org.apache.ws.jaxme.xs.jaxb.impl.JAXBParser;
 import org.apache.ws.jaxme.xs.jaxb.impl.JAXBXsObjectFactoryImpl;
@@ -187,12 +188,12 @@
 		return new JAXBSchemaSG(pController, pSchema);
 	}
 	
-	public TypeSG getTypeSG(SGFactory pController, XSType pType) throws SAXException {
+	public TypeSG getTypeSG(SGFactory pController, XSType pType, JAXBProperty.BaseType pBaseType) throws SAXException {
 		final String mName = "getTypeSG(XSType)";
 		TypeSG result = (TypeSG) types.get(pType);
 		if (result == null) {
 			log.finest(mName, "->", pType.getName());
-			TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType);
+			TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType, pBaseType);
 			result = new TypeSGImpl(chain);
 			types.put(pType, result);
 			typesByOrder.add(result);
@@ -202,17 +203,17 @@
 		return result;
 	}
 	
-	public Object newTypeSG(SGFactory pController, XSType pType) throws SAXException {
+	public Object newTypeSG(SGFactory pController, XSType pType, JAXBProperty.BaseType pBaseType) throws SAXException {
 		if (schemaSG == null) {
 			throw new IllegalStateException("A schema has not yet been created");
 		}
-		return new JAXBTypeSG(pController, schemaSG, pType);
+		return new JAXBTypeSG(pController, schemaSG, pType, pBaseType);
 	}
 	
-	public TypeSG getTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName) throws SAXException {
+	public TypeSG getTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException {
 		final String mName = "getTypeSG(XSType,ClassContext)";
 		log.finest(mName, "->", new Object[]{pType, pClassContext});
-        TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType, pClassContext, pName);
+        TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType, pClassContext, pName, pBaseType);
 		TypeSG result = new TypeSGImpl(chain);
 		typesByOrder.add(result);
 		result.init();
@@ -220,22 +221,24 @@
 		return result;
 	}
 	
-	public Object newTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName) throws SAXException {
+	public Object newTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName,
+			JAXBProperty.BaseType pBaseType) throws SAXException {
 		if (schemaSG == null) {
 			throw new IllegalStateException("A schema has not yet been created");
 		}
-		return new JAXBTypeSG(pController, schemaSG, pType, pClassContext, pName);
+		return new JAXBTypeSG(pController, schemaSG, pType, pClassContext, pName, pBaseType);
 	}
 	
-	public Object newTypeSG(SGFactory pController, XSType pType, XsQName pName) throws SAXException {
+	public Object newTypeSG(SGFactory pController, XSType pType, XsQName pName,
+			JAXBProperty.BaseType pBaseType) throws SAXException {
 		if (schemaSG == null) {
 			throw new IllegalStateException("A schema has not yet been created");
 		}
-		return new JAXBTypeSG(pController, schemaSG, pType, pName);
+		return new JAXBTypeSG(pController, schemaSG, pType, pName, pBaseType);
 	}
 	
-	public TypeSG getTypeSG(SGFactory pController, XSType pType, XsQName pName) throws SAXException {
-		TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType, pName);
+	public TypeSG getTypeSG(SGFactory pController, XSType pType, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException {
+		TypeSGChain chain = (TypeSGChain) pController.newTypeSG(pType, pName, pBaseType);
 		TypeSG result = new TypeSGImpl(chain);
 		typesByOrder.add(result);
 		result.init();

Modified: webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java (original)
+++ webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java Thu Aug 31 05:29:41 2006
@@ -153,7 +153,7 @@
     if (type == null) {
       return null;
     }
-    typeSG = pController.getFactory().getTypeSG(type);
+    typeSG = pController.getFactory().getTypeSG(type, null);
     typesByName.put(pName, typeSG);
     return typeSG;
   }

Modified: webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSimpleContentTypeSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSimpleContentTypeSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSimpleContentTypeSG.java (original)
+++ webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSimpleContentTypeSG.java Thu Aug 31 05:29:41 2006
@@ -40,7 +40,7 @@
     xsType = pType;
     typeSG = pComplexTypeSG.getTypeSG();
     XSType theSimpleType = pType.getComplexType().getSimpleContent().getType();
-    contentTypeSG = typeSG.getFactory().getTypeSG(theSimpleType, pComplexTypeSG.getClassContext(), null);
+    contentTypeSG = typeSG.getFactory().getTypeSG(theSimpleType, pComplexTypeSG.getClassContext(), null, null);
   }
 
   public Object newPropertySGChain(SimpleContentSG pController) throws SAXException {

Modified: webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java (original)
+++ webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java Thu Aug 31 05:29:41 2006
@@ -67,6 +67,7 @@
 import org.apache.ws.jaxme.xs.jaxb.JAXBEnumeration;
 import org.apache.ws.jaxme.xs.jaxb.JAXBGlobalBindings;
 import org.apache.ws.jaxme.xs.jaxb.JAXBJavaType;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
 import org.apache.ws.jaxme.xs.jaxb.JAXBSchema;
 import org.apache.ws.jaxme.xs.jaxb.JAXBSchemaBindings;
 import org.apache.ws.jaxme.xs.jaxb.JAXBSimpleType;
@@ -135,17 +136,19 @@
   private final XsQName name;
   private Map properties;
   private final XsSchemaHeader schemaHeader;
+  private final JAXBProperty.BaseType baseType;
 
   /** <p>Creates a new, global instance of JAXBTypeSG.</p>
    */
-  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType)
+  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType, JAXBProperty.BaseType pBaseType)
       throws SAXException {
-    this(pFactory, pSchema, pType, null, pType.getName());
+    this(pFactory, pSchema, pType, null, pType.getName(), pBaseType);
     isGlobalClass = true;
   }
 
-  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType, XsQName pName) throws SAXException {
-    this(pFactory, pSchema, pType, null, pName);
+  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType, XsQName pName,
+		  JAXBProperty.BaseType pBaseType) throws SAXException {
+    this(pFactory, pSchema, pType, null, pName, pBaseType);
     isGlobalClass = true;
   }
 
@@ -155,7 +158,7 @@
       XsQName name = pReferencedType.getName();
       TypeSG result;
       if (pReferencedType.isGlobal()) {
-      	  result = pFactory.getTypeSG(pReferencedType);
+      	  result = pFactory.getTypeSG(pReferencedType, null);
       	  if (result == null) {
       	  	  throw new SAXParseException("Unknown global type " + name,
       	  	  		                      pReferencingType.getLocator());
@@ -169,9 +172,11 @@
   /** <p>Creates a new, local instance of JAXBTypeSG. Classes are generated
    * into the given context.</p>
    */
-  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType, Context pClassContext, XsQName pName)
+  protected JAXBTypeSG(SGFactory pFactory, SchemaSG pSchema, XSType pType, Context pClassContext, XsQName pName,
+		  JAXBProperty.BaseType pBaseType)
       throws SAXException {
     super(pFactory, pSchema, pType);
+    baseType = pBaseType;
     name = pName;
     xsType = pType;
     if (pType.isSimple()) {
@@ -628,6 +633,9 @@
 
   private JAXBJavaType findJavaType(SchemaSG pSchema, XSType pType)
       throws SAXException {
+	if (baseType != null  &&  baseType.getJavaType() != null) {
+		return baseType.getJavaType();
+	}
     JAXBJavaType[] globalJavaTypes = pSchema.getJAXBJavaTypes();
     
     for (XSType currentType = pType;  currentType != null;  ) {

Modified: webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/ListTypeSGImpl.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/ListTypeSGImpl.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/ListTypeSGImpl.java (original)
+++ webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/ListTypeSGImpl.java Thu Aug 31 05:29:41 2006
@@ -83,7 +83,7 @@
   }
 
   public void init(SimpleTypeSG pController) throws SAXException {
-    itemType = getFactory().getTypeSG(listType.getItemType(), classContext, name);
+    itemType = getFactory().getTypeSG(listType.getItemType(), classContext, name, null);
   }
 
   protected TypeSG getItemType() {

Modified: webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/UnionTypeSGImpl.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/UnionTypeSGImpl.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/UnionTypeSGImpl.java (original)
+++ webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/UnionTypeSGImpl.java Thu Aug 31 05:29:41 2006
@@ -57,7 +57,7 @@
     XSType[] mTypes = unionType.getMemberTypes();
     List members = new ArrayList();
     for (int i = 0;  i < mTypes.length;  i++) {
-      TypeSG typeSG = getFactory().getTypeSG(mTypes[i], pClassContext, pName);
+      TypeSG typeSG = getFactory().getTypeSG(mTypes[i], pClassContext, pName, null);
       typeSG.getSimpleTypeSG().setNullable(true);
       members.add(typeSG);
     }

Modified: webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/junit/BindingsTest.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/junit/BindingsTest.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/junit/BindingsTest.java (original)
+++ webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/junit/BindingsTest.java Thu Aug 31 05:29:41 2006
@@ -55,6 +55,7 @@
 	public void testBindings() throws Exception {
 		FooType foo = new ObjectFactory().createFoo();
 		foo.setBar(YesNoTypeClass.YES);
+		foo.setBool(Boolean.TRUE);
 		ImpFooType impFoo = new org.apache.ws.jaxme.test.bindings.imported.vo.ObjectFactory().createImpFoo();
 		impFoo.setXyz(org.apache.ws.jaxme.test.bindings.imported.vo.YesNoTypeClass.NO);
 	}

Modified: webservices/jaxme/branches/b0_5/src/pm/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/pm/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/pm/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java (original)
+++ webservices/jaxme/branches/b0_5/src/pm/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java Thu Aug 31 05:29:41 2006
@@ -56,6 +56,7 @@
 import org.apache.ws.jaxme.xs.XSObject;
 import org.apache.ws.jaxme.xs.XSSchema;
 import org.apache.ws.jaxme.xs.XSType;
+import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
 import org.apache.ws.jaxme.xs.parser.XsObjectCreator;
 import org.apache.ws.jaxme.xs.parser.impl.LocSAXException;
 import org.apache.ws.jaxme.xs.types.XSBase64Binary;
@@ -544,16 +545,16 @@
     }
   }
 
-  public Object newTypeSG(SGFactory pController, XSType pType) throws SAXException {
-    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType), pType);
+  public Object newTypeSG(SGFactory pController, XSType pType, JAXBProperty.BaseType pBaseType) throws SAXException {
+    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType, pBaseType), pType);
   }
 
-  public Object newTypeSG(SGFactory pController, XSType pType, XsQName pName) throws SAXException {
-    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType, pName), pType);
+  public Object newTypeSG(SGFactory pController, XSType pType, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException {
+    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType, pName, pBaseType), pType);
   }
 
-  public Object newTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName) throws SAXException {
-    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType, pClassContext, pName), pType);
+  public Object newTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName, JAXBProperty.BaseType pBaseType) throws SAXException {
+    return new JdbcTypeSG(this, (TypeSGChain) super.newTypeSG(pController, pType, pClassContext, pName, pBaseType), pType);
   }
 
   public Object newSchemaSG(SGFactory pController, XSSchema pSchema) throws SAXException {

Modified: webservices/jaxme/branches/b0_5/src/test/jaxb/bindings/bindings.jxb
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/test/jaxb/bindings/bindings.jxb?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/test/jaxb/bindings/bindings.jxb (original)
+++ webservices/jaxme/branches/b0_5/src/test/jaxb/bindings/bindings.jxb Thu Aug 31 05:29:41 2006
@@ -25,6 +25,13 @@
     <jxb:bindings node="xs:simpleType[@name='YesNoType']">
       <jxb:typesafeEnumClass/>
     </jxb:bindings>
+    <jxb:bindings node="xs:element[@name='foo']/xs:complexType/xs:attribute[@name='bool']">
+      <jxb:property>
+        <jxb:baseType>
+          <jxb:javaType name='java.lang.Boolean'/>
+        </jxb:baseType>
+      </jxb:property>
+    </jxb:bindings>
   </jxb:bindings>
 
   <jxb:bindings schemaLocation="imported.xsi" node="/xs:schema">

Modified: webservices/jaxme/branches/b0_5/src/test/jaxb/bindings/bindings.xsd
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/test/jaxb/bindings/bindings.xsd?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/src/test/jaxb/bindings/bindings.xsd (original)
+++ webservices/jaxme/branches/b0_5/src/test/jaxb/bindings/bindings.xsd Thu Aug 31 05:29:41 2006
@@ -30,6 +30,7 @@
       </xs:sequence>
       <xs:attribute name="bar" type="bnd:YesNoType"/>
       <xs:attribute name="blabb" type="imp:YesNoType"/>
+      <xs:attribute name="bool" type="xs:boolean"/>
     </xs:complexType>
   </xs:element>
 

Modified: webservices/jaxme/branches/b0_5/status.xml
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/status.xml?rev=438889&r1=438888&r2=438889&view=diff
==============================================================================
--- webservices/jaxme/branches/b0_5/status.xml (original)
+++ webservices/jaxme/branches/b0_5/status.xml Thu Aug 31 05:29:41 2006
@@ -63,6 +63,9 @@
       <action dev="JW" type="fix" context="generator">
         The jaxb:class customization wasn't honoured by anonymous types.
       </action>
+      <action dev="JW" type="fix" context="generator">
+        The element jaxb:property/jaxb:baseType/jaxb:javaType wasn't honured.
+      </action>
     </release>
     <release version="0.5.1" date="06-Jan-2006">
       <action dev="JW" type="enhancement" context="js">



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