cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r586783 - in /incubator/cxf/branches/2.0.x-fixes: ./ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
Date Sat, 20 Oct 2007 19:21:50 GMT
Author: dkulp
Date: Sat Oct 20 12:21:49 2007
New Revision: 586783

URL: http://svn.apache.org/viewvc?rev=586783&view=rev
Log:
Merged revisions 586501 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r586501 | dkulp | 2007-10-19 11:27:20 -0400 (Fri, 19 Oct 2007) | 2 lines
  
  CXF-1121 - patch from Adrian Nistor applied.   Thanks!
........

Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java?rev=586783&r1=586782&r2=586783&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
Sat Oct 20 12:21:49 2007
@@ -23,12 +23,15 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.GenericArrayType;
 import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.xml.bind.annotation.XmlTransient;
+
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.service.ServiceModelVisitor;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -172,28 +175,33 @@
         }
     }
 
-    
-    private void walkReferences(Class<?> cls) {
-        if (cls.getName().startsWith("java.")
-            || cls.getName().startsWith("javax.")) {
-            return;
-        }
-        //walk the public fields/methods to try and find all the classes.  JAXB will only
load the 
-        //EXACT classes in the fields/methods if they are in a different package.   Thus,
-        //subclasses won't be found and the xsi:type stuff won't work at all.
+    private void walkReferences(Class<?> cls) { 
+        if (cls.getName().startsWith("java.") 
+            || cls.getName().startsWith("javax.")) { 
+            return; 
+        } 
+        //walk the public fields/methods to try and find all the classes. JAXB will only
load the 
+        //EXACT classes in the fields/methods if they are in a different package. Thus, 
+        //subclasses won't be found and the xsi:type stuff won't work at all. 
         //We'll grab the public field/method types and then add the ObjectFactory stuff 
-        //as well as look for jaxb.index files in those packages.
-        
-        Field fields[] = cls.getFields();
-        for (Field f : fields) {
-            addType(f.getGenericType());
-        }
-        Method methods[] = cls.getMethods();
-        for (Method m : methods) {
-            addType(m.getGenericReturnType());
-            for (Type t : m.getGenericParameterTypes()) {
-                addType(t);
-            }
-        }
-    }
+        //as well as look for jaxb.index files in those packages. 
+
+        Field fields[] = cls.getFields(); 
+        for (Field f : fields) { 
+            if (f.getAnnotation(XmlTransient.class) == null
+                && !Modifier.isStatic(f.getModifiers())) { 
+                addType(f.getGenericType()); 
+            } 
+        } 
+        Method methods[] = cls.getMethods(); 
+        for (Method m : methods) { 
+            if (m.getAnnotation(XmlTransient.class) == null
+                && !Modifier.isStatic(m.getModifiers())) { 
+                addType(m.getGenericReturnType()); 
+                for (Type t : m.getGenericParameterTypes()) { 
+                    addType(t); 
+                } 
+            } 
+        } 
+    } 
 }



Mime
View raw message