cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1488906 - in /cxf/branches/2.5.x-fixes: ./ rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Date Mon, 03 Jun 2013 09:00:05 GMT
Author: ffang
Date: Mon Jun  3 09:00:05 2013
New Revision: 1488906

URL: http://svn.apache.org/r1488906
Log:
Merged revisions 1488901 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

................
  r1488901 | ffang | 2013-06-03 16:52:57 +0800 (一, 03  6 2013) | 16 lines
  
  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.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java

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

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

Modified: cxf/branches/2.5.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=1488906&r1=1488905&r2=1488906&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Mon Jun  3 09:00:05 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 {



Mime
View raw message