cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1381379 - /cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Date Wed, 05 Sep 2012 21:18:07 GMT
Author: dkulp
Date: Wed Sep  5 21:18:07 2012
New Revision: 1381379

URL: http://svn.apache.org/viewvc?rev=1381379&view=rev
Log:
[CXF-4497] Ability to skip the JAXB package scanning
Patch from Jason Pell applied

Modified:
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=1381379&r1=1381378&r2=1381379&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java (original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java Wed
Sep  5 21:18:07 2012
@@ -99,6 +99,8 @@ public class JAXBDataBinding extends Abs
 
     public static final String USE_JAXB_BRIDGE = "use.jaxb.bridge";
 
+    public static final String JAXB_SCAN_PACKAGES = "jaxb.scanPackages";
+
     private static final Logger LOG = LogUtils.getLogger(JAXBDataBinding.class);
 
     private static final Class<?> SUPPORTED_READER_FORMATS[] = new Class<?>[]
{Node.class,
@@ -194,7 +196,7 @@ public class JAXBDataBinding extends Abs
     private ValidationEventHandler validationEventHandler;
 
     private boolean unwrapJAXBElement = true;
-
+    private boolean scanPackages = true;
     private boolean qualifiedSchemas;
 
     private ModCountCopyOnWriteArrayList<Interceptor<? extends Message>> in
@@ -229,6 +231,9 @@ public class JAXBDataBinding extends Abs
             extraClass = (Class[])o;
         }
 
+        if (props != null && "false".equalsIgnoreCase((String) props.get(JAXB_SCAN_PACKAGES)))
{
+            scanPackages = false;
+        }
     }
 
     public JAXBDataBinding(JAXBContext context) {
@@ -448,13 +453,14 @@ public class JAXBDataBinding extends Abs
                 classes.add(clz);
             }
         }
-        JAXBContextCache.scanPackages(classes);
+        if (scanPackages) {
+            JAXBContextCache.scanPackages(classes);
+        }
         addWsAddressingTypes(classes);
-
+        
         return JAXBContextCache.getCachedContextAndSchemas(classes, defaultNs,  
                                                           contextProperties, 
                                                           typeRefs, true);
-
     }
 
 



Mime
View raw message