cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1188894 - in /cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis: databinding/AegisDatabinding.java type/basic/BeanType.java
Date Tue, 25 Oct 2011 20:30:12 GMT
Author: dkulp
Date: Tue Oct 25 20:30:11 2011
New Revision: 1188894

URL: http://svn.apache.org/viewvc?rev=1188894&view=rev
Log:
[CXF-3870] Map interface heirachy into schema as well

Modified:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java?rev=1188894&r1=1188893&r2=1188894&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
Tue Oct 25 20:30:11 2011
@@ -99,6 +99,10 @@ public class AegisDatabinding extends Ab
         super();
         part2Type = new HashMap<MessagePartInfo, AegisType>();
     }
+    public AegisDatabinding(AegisContext ctx) {
+        this();
+        aegisContext = ctx;
+    }
 
     /**
      * The Databinding API has initialize(Service). However, this object should be usable
even if that API is
@@ -366,7 +370,7 @@ public class AegisDatabinding extends Ab
 
             // QName elName = getSuggestedName(service, op, param)
             deps.add(type);
-
+            type.getTypeMapping().register(type);
             addDependencies(deps, type);
         }
     }
@@ -547,6 +551,9 @@ public class AegisDatabinding extends Ab
 
     private AegisType getParameterType(Service s, TypeMapping tm, MessagePartInfo param,
int paramtype) {
         AegisType type = tm.getType(param.getTypeQName());
+        if (type != null && type.getTypeClass() != param.getTypeClass()) {
+            type = null;
+        }
 
         int offset = 0;
         if (paramtype == OUT_PARAM) {

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java?rev=1188894&r1=1188893&r2=1188894&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
Tue Oct 25 20:30:11 2011
@@ -535,11 +535,9 @@ public class BeanType extends AegisType 
         /*
          * Automagically add chain of superclasses if this is an an extension.
          */
-        if (inf.isExtension()) {
-            AegisType sooperType = getSuperType();
-            if (sooperType != null) {
-                deps.add(sooperType);
-            }
+        AegisType sooperType = getSuperType();
+        if (sooperType != null) {
+            deps.add(sooperType);
         }
 
         return deps;
@@ -574,7 +572,12 @@ public class BeanType extends AegisType 
      */
     public AegisType getSuperType() {
         BeanTypeInfo inf = getTypeInfo();
-        Class c = inf.getTypeClass().getSuperclass();
+        Class c = inf.getTypeClass();
+        if (c.isInterface() && c.getInterfaces().length == 1) {
+            c = c.getInterfaces()[0];
+        } else {
+            c = c.getSuperclass();
+        }
         /*
          * Don't dig any deeper than Object or Exception
          */
@@ -584,11 +587,12 @@ public class BeanType extends AegisType 
             if (superType == null) {
                 // if we call createType, we know that we'll get a BeanType. */
                 superType = (BeanType)getTypeMapping().getTypeCreator().createType(c);
-                Class cParent = c.getSuperclass();
-                if (cParent != null && cParent != Object.class) {
-                    ((BeanType)superType).getTypeInfo().setExtension(true);
+                if (superType != null) {
+                    tm.register(superType);
+                    this.info.setExtension(true);
                 }
-                tm.register(superType);
+            } else {
+                this.info.setExtension(true);
             }
             return superType;
         } else {



Mime
View raw message