You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2013/06/03 10:52:58 UTC

svn commit: r1488901 - in /cxf/branches/2.6.x-fixes: ./ rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java

Author: ffang
Date: Mon Jun  3 08:52:57 2013
New Revision: 1488901

URL: http://svn.apache.org/r1488901
Log:
Merged revisions 1488891 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1488891 | ffang | 2013-06-03 16:36:41 +0800 (一, 03  6 2013) | 9 lines
  
  Merged revisions 1488890 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1488890 | ffang | 2013-06-03 16:26:30 +0800 (一, 03  6 2013) | 1 line
    
    [CXF-5049]Support for schema compiler options in DynamicClientFactory
  ........
................

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1488891
  Merged /cxf/trunk:r1488890

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

Modified: cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=1488901&r1=1488900&r2=1488901&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java (original)
+++ cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java Mon Jun  3 08:52:57 2013
@@ -133,6 +133,7 @@ public class DynamicClientFactory {
     private boolean allowRefs;
     
     private Map<String, Object> jaxbContextProperties;
+    private String[] schemaCompilerOptions;
     
     protected DynamicClientFactory(Bus bus) {
         this.bus = bus;
@@ -150,6 +151,10 @@ public class DynamicClientFactory {
         allowRefs = b;
     }
 
+    public void setSchemaCompilerOptions(String[] options) {
+        this.schemaCompilerOptions = options;
+    }
+    
     /**
      * Create a new instance using a specific <tt>Bus</tt>.
      * 
@@ -278,8 +283,6 @@ public class DynamicClientFactory {
         return createClient(wsdlUrl.toString(), service, classLoader, port, bindingFiles);
     }
     
-    
-    
     public Client createClient(String wsdlUrl, QName service,
                                ClassLoader classLoader, QName port,
                                List<String> bindingFiles) {
@@ -300,8 +303,7 @@ public class DynamicClientFactory {
         //all SI's should have the same schemas
         SchemaCollection schemas = svc.getServiceInfos().get(0).getXmlSchemaCollection();
 
-        SchemaCompiler compiler = 
-            JAXBUtils.createSchemaCompilerWithDefaultAllocator(new HashSet<String>());
+        SchemaCompiler compiler = createSchemaCompiler();
         
         InnerErrorListener listener = new InnerErrorListener(wsdlUrl);
         Object elForRun = ReflectionInvokationHandler
@@ -415,6 +417,15 @@ public class DynamicClientFactory {
         return false;
     }
     
+    protected SchemaCompiler createSchemaCompiler() {
+        SchemaCompiler compiler = 
+            JAXBUtils.createSchemaCompilerWithDefaultAllocator(new HashSet<String>());
+        if (schemaCompilerOptions != null && schemaCompilerOptions.length > 0) {
+            compiler.getOptions().parseArguments(schemaCompilerOptions);
+        }
+        return compiler;
+    }
+    
     private void addBindingFiles(List<String> bindingFiles, SchemaCompiler compiler) {
         if (bindingFiles != null) {
             for (String s : bindingFiles) {
@@ -787,8 +798,7 @@ public class DynamicClientFactory {
     public void setJaxbContextProperties(Map<String, Object> jaxbContextProperties) {
         this.jaxbContextProperties = jaxbContextProperties;
     }
-    
-    
+
     private void hackInNewInternalizationLogic(SchemaCompiler schemaCompiler,
                                                final OASISCatalogManager catalog) {
         try {