cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r475169 - in /incubator/cxf/trunk: common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java rt/databinding/jaxb/pom.xml rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
Date Wed, 15 Nov 2006 09:32:00 GMT
Author: ffang
Date: Wed Nov 15 01:31:57 2006
New Revision: 475169

URL: http://svn.apache.org/viewvc?view=rev&rev=475169
Log:
[CXF-55] JAXB databinding has dependency on JAX-WS
                        

Modified:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java
    incubator/cxf/trunk/rt/databinding/jaxb/pom.xml
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java?view=diff&rev=475169&r1=475168&r2=475169
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java Wed
Nov 15 01:31:57 2006
@@ -31,6 +31,7 @@
 import java.util.concurrent.Future;
 
 import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Holder;
 import javax.xml.ws.Response;
 
 import org.apache.cxf.helpers.JavaUtils;
@@ -430,6 +431,31 @@
             firstWord = false;
         }
         return buf.toString();
+    }
+    
+    public static Class<?> getValidClass(Class<?> cls) {
+        if (cls.isEnum()) {
+            return cls;
+        }
+        if (cls.isArray()) {
+            return cls;
+        }
+
+        if (cls == Object.class || cls == String.class || cls == Holder.class) {
+            cls = null;
+        } else if (cls.isPrimitive() || cls.isInterface() || cls.isAnnotation()) {
+            cls = null;
+        }
+        if (cls != null) {
+            try {
+                if (cls.getConstructor(new Class[0]) == null) {
+                    cls = null;
+                }
+            } catch (NoSuchMethodException ex) {
+                cls = null;
+            }
+        }
+        return cls;
     }
 
 }

Modified: incubator/cxf/trunk/rt/databinding/jaxb/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/pom.xml?view=diff&rev=475169&r1=475168&r2=475169
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/pom.xml (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/pom.xml Wed Nov 15 01:31:57 2006
@@ -138,10 +138,6 @@
 
         <dependency>
             <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-impl</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
             <artifactId>jaxb-xjc</artifactId>
         </dependency>
     </dependencies>

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java?view=diff&rev=475169&r1=475168&r2=475169
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
Wed Nov 15 01:31:57 2006
@@ -26,8 +26,6 @@
 import java.util.Collection;
 import java.util.Set;
 
-import javax.xml.ws.Holder;
-
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.service.ServiceModelVisitor;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -93,7 +91,7 @@
         if (cls.isArray() && cls.getComponentType().isPrimitive()) {
             return;
         }
-        cls = getValidClass(cls);
+        cls = JAXBUtils.getValidClass(cls);
         if (null != cls) {
             if (cls.isEnum()) {
                 // The object factory stuff doesn't work for enums
@@ -112,28 +110,5 @@
         }
     }
 
-    private static Class<?> getValidClass(Class<?> cls) {
-        if (cls.isEnum()) {
-            return cls;
-        }
-        if (cls.isArray()) {
-            return cls;
-        }
-
-        if (cls == Object.class || cls == String.class || cls == Holder.class) {
-            cls = null;
-        } else if (cls.isPrimitive() || cls.isInterface() || cls.isAnnotation()) {
-            cls = null;
-        }
-        if (cls != null) {
-            try {
-                if (cls.getConstructor(new Class[0]) == null) {
-                    cls = null;
-                }
-            } catch (NoSuchMethodException ex) {
-                cls = null;
-            }
-        }
-        return cls;
-    }
+    
 }



Mime
View raw message