cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r945889 - in /cxf/branches/2.2.x-fixes: ./ tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/
Date Tue, 18 May 2010 21:16:19 GMT
Author: dkulp
Date: Tue May 18 21:16:17 2010
New Revision: 945889

URL: http://svn.apache.org/viewvc?rev=945889&view=rev
Log:
Merged revisions 945466,945468 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r945466 | dkulp | 2010-05-17 22:25:58 -0400 (Mon, 17 May 2010) | 1 line
  
  W3CEndpointReference is final, make sure we don't try and subclass it
........
  r945468 | dkulp | 2010-05-17 22:26:17 -0400 (Mon, 17 May 2010) | 1 line
  
  Fix previous commit that broke usage with JAXB 2.1
........

Added:
    cxf/branches/2.2.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/W3CEPRJaxbBinding_jaxb22.xml
      - copied unchanged from r945468, cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/W3CEPRJaxbBinding_jaxb22.xml
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
    cxf/branches/2.2.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/W3CEPRJaxbBinding.xml

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:945466,945468

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

Modified: cxf/branches/2.2.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?rev=945889&r1=945888&r2=945889&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Tue May 18 21:16:17 2010
@@ -23,6 +23,8 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Writer;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
 import java.lang.reflect.Field;
 import java.net.URI;
 import java.net.URL;
@@ -38,6 +40,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.xml.XMLConstants;
+import javax.xml.bind.annotation.XmlElement;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
@@ -305,7 +308,11 @@ public class JAXBDataBinding implements 
         if (context.get(ToolConstants.CFG_NO_ADDRESS_BINDING) == null) {
             //hard code to enable jaxb extensions
             args.add("-extension");
-            URL bindingFileUrl = getClass().getResource("W3CEPRJaxbBinding.xml");
+            String name = "W3CEPRJaxbBinding.xml";
+            if (isJAXB22()) {
+                name = "W3CEPRJaxbBinding_jaxb22.xml";
+            }
+            URL bindingFileUrl = getClass().getResource(name);
             InputSource ins = new InputSource(bindingFileUrl.toString());
             opts.addBindFile(ins);
         }
@@ -394,6 +401,17 @@ public class JAXBDataBinding implements 
         initialized = true;
     }
     
+    private boolean isJAXB22() {
+        Target t = XmlElement.class.getAnnotation(Target.class);
+        //JAXB 2.2 allows XmlElement on params.
+        for (ElementType et : t.value()) {
+            if (et == ElementType.PARAMETER) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     private static final class ReferenceFinder extends AbstractReferenceFinderImpl {
         private Locator locator;
         private OASISCatalogManager catalog;

Modified: cxf/branches/2.2.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/W3CEPRJaxbBinding.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/W3CEPRJaxbBinding.xml?rev=945889&r1=945888&r2=945889&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/W3CEPRJaxbBinding.xml
(original)
+++ cxf/branches/2.2.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/W3CEPRJaxbBinding.xml
Tue May 18 21:16:17 2010
@@ -17,23 +17,25 @@ KIND, either express or implied. See the
 specific language governing permissions and limitations
 under the License.
 -->
-<bindings xmlns="http://java.sun.com/xml/ns/jaxb" xmlns:wsa="http://www.w3.org/2005/08/addressing"
version="2.1">
+<bindings xmlns="http://java.sun.com/xml/ns/jaxb" 
+	xmlns:wsa="http://www.w3.org/2005/08/addressing"
+	version="2.1">
 	<bindings scd="x-schema::wsa" if-exists="true">
 		<schemaBindings map="false" />
 		<bindings scd="wsa:EndpointReference">
-			<class ref="javax.xml.ws.wsaddressing.W3CEndpointReference" />
+			<class ref="javax.xml.ws.wsaddressing.W3CEndpointReference"/>
 		</bindings>
 		<bindings scd="wsa:ReplyTo">
-			<class ref="javax.xml.ws.wsaddressing.W3CEndpointReference" />
+			<class ref="javax.xml.ws.wsaddressing.W3CEndpointReference"/>
 		</bindings>
 		<bindings scd="wsa:FaultTo">
-			<class ref="javax.xml.ws.wsaddressing.W3CEndpointReference" />
+			<class ref="javax.xml.ws.wsaddressing.W3CEndpointReference"/>
 		</bindings>
 		<bindings scd="wsa:From">
-			<class ref="javax.xml.ws.wsaddressing.W3CEndpointReference" />
+			<class ref="javax.xml.ws.wsaddressing.W3CEndpointReference"/>
 		</bindings>
 		<bindings scd="~wsa:EndpointReferenceType">
-			<class ref="javax.xml.ws.wsaddressing.W3CEndpointReference" />
+			<class ref="javax.xml.ws.wsaddressing.W3CEndpointReference"/>
 		</bindings>
 	</bindings>
 </bindings>
\ No newline at end of file



Mime
View raw message