cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/2] cxf git commit: [CXF-6245] Remove refrence to xmlbeans from jaxws
Date Mon, 09 Feb 2015 19:53:54 GMT
[CXF-6245] Remove refrence to xmlbeans from jaxws


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c58fec8d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c58fec8d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c58fec8d

Branch: refs/heads/3.0.x-fixes
Commit: c58fec8de549d62780dc1c4890090fe84b46b5c3
Parents: 268735e
Author: Daniel Kulp <dkulp@apache.org>
Authored: Mon Feb 9 14:37:02 2015 -0500
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Mon Feb 9 14:53:43 2015 -0500

----------------------------------------------------------------------
 .../cxf/databinding/AbstractWrapperHelper.java      | 15 +++++++++++++++
 .../apache/cxf/xmlbeans/XmlBeansWrapperHelper.java  | 10 ----------
 .../interceptors/WrapperClassOutInterceptor.java    | 16 ++++------------
 3 files changed, 19 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c58fec8d/core/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java b/core/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java
index dcc09c9..b597c5f 100644
--- a/core/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java
+++ b/core/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java
@@ -39,6 +39,8 @@ public abstract class AbstractWrapperHelper implements WrapperHelper {
     protected final Method setMethods[];
     protected final Method getMethods[];    
     protected final Field fields[];   
+    protected boolean validate;
+    
                  
     protected AbstractWrapperHelper(Class<?> wt,
                   Method sets[],
@@ -50,6 +52,19 @@ public abstract class AbstractWrapperHelper implements WrapperHelper {
         wrapperType = wt;        
     }
     
+    /**
+     * WrapperClassOutInterceptor may call this if the wrapper class needs to be validated.
+     * Implementations may choose to ignore this as the SchemaValidation that occurs later
+     * may catch the errors, but this allows quicker failures if the databinding 
+     * can support it.
+     */
+    public void setValidate(boolean v) {
+        validate = v;
+    }
+    public boolean getValidate() {
+        return validate;
+    }
+    
     public String getSignature() {
         return "" + System.identityHashCode(this);
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c58fec8d/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java
b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java
index 55ed32a..6b41ebe 100644
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java
+++ b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java
@@ -28,20 +28,10 @@ import org.apache.xmlbeans.XmlOptions;
 
 public class XmlBeansWrapperHelper extends AbstractWrapperHelper {
     
-    private boolean validate;
-            
     public XmlBeansWrapperHelper(Class<?> wt, Method[] sets, Method[] gets, Field[]
f) {
         super(wt, sets, gets, f);
        
     }
-    
-    public void setValidate(boolean v) {
-        validate = v;
-    }
-    
-    public boolean getValidate() {
-        return validate;
-    }
 
     @Override
     protected Object createWrapperObject(Class<?> typeClass) throws Exception {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c58fec8d/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
index 8c2a889..7a06181 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
@@ -19,13 +19,13 @@
 
 package org.apache.cxf.jaxws.interceptors;
 
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
 
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.annotations.SchemaValidation.SchemaValidationType;
+import org.apache.cxf.databinding.AbstractWrapperHelper;
 import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.databinding.WrapperCapableDatabinding;
 import org.apache.cxf.databinding.WrapperHelper;
@@ -85,17 +85,9 @@ public class WrapperClassOutInterceptor extends AbstractPhaseInterceptor<Message
             
             try {
                 MessageContentsList newObjs = new MessageContentsList();
-                // set the validate option for XMLBeans Wrapper Helper
-                if (ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.OUT, message))
{
-                    try {
-                        Class<?> xmlBeanWrapperHelperClass = 
-                            Class.forName("org.apache.cxf.xmlbeans.XmlBeansWrapperHelper");
-                        if (xmlBeanWrapperHelperClass.isInstance(helper)) {
-                            Method method = xmlBeanWrapperHelperClass.getMethod("setValidate",
boolean.class);
-                            method.invoke(helper, true);
-                        }
-                    } catch (Exception exception) {
-                        // do nothing there
+                if (ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.OUT, message)
+                    && helper instanceof AbstractWrapperHelper) { {
+                        ((AbstractWrapperHelper)helper).setValidate(true);
                     }
                 }
                 Object o2 = helper.createWrapperObject(objs);


Mime
View raw message