axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r660529 - /webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java
Date Tue, 27 May 2008 14:26:39 GMT
Author: amilas
Date: Tue May 27 07:26:37 2008
New Revision: 660529

URL: http://svn.apache.org/viewvc?rev=660529&view=rev
Log:
added the bindig file option for jaxbri

Modified:
    webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java

Modified: webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java?rev=660529&r1=660528&r2=660529&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java
Tue May 27 07:26:37 2008
@@ -56,11 +56,7 @@
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.StringReader;
+import java.io.*;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -70,6 +66,8 @@
 public class CodeGenerationUtility {
     private static final Log log = LogFactory.getLog(CodeGenerationUtility.class);
 
+    public static final String BINDING_FILE_NAME = "bindingFileName";
+
     /**
      * @param additionalSchemas
      * @throws RuntimeException
@@ -146,11 +144,19 @@
                 }
             };
 
+
+            Map properties = cgconfig.getProperties();
+            String bindingFileName = (String) properties.get(BINDING_FILE_NAME);
+
             XmlSchema key = null;
             for (Iterator schemaIter = schemaToInputSourceMap.keySet().iterator();
                  schemaIter.hasNext();) {
 
                 SchemaCompiler sc = XJC.createSchemaCompiler();
+                if (bindingFileName != null){
+                    sc.getOptions().addBindFile(new InputSource(new FileInputStream(bindingFileName)));
+                }
+
                 key = (XmlSchema) schemaIter.next();
 
                 if (nsMap != null) {



Mime
View raw message