cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r956036 - /cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
Date Fri, 18 Jun 2010 16:14:36 GMT
Author: dkulp
Date: Fri Jun 18 16:14:36 2010
New Revision: 956036

URL: http://svn.apache.org/viewvc?rev=956036&view=rev
Log:
[CXF-2855] Fix issue with xjc customizations not getting through to XJC
plugins.

Patch from "nitro" applied.

Modified:
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=956036&r1=956035&r2=956036&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
Fri Jun 18 16:14:36 2010
@@ -238,7 +238,9 @@ public final class CustomizationParser {
     }
 
     protected void copyAllJaxbDeclarations(final Node schemaNode, final Element jaxwsBindingNode)
{
-        appendJaxbVersion((Element)schemaNode);
+        if (isSchemaElement((Element)schemaNode)) {
+            appendJaxbVersion((Element)schemaNode);
+        }
 
         Node[] embededNodes = getAnnotationNodes(schemaNode);
         Node annotationNode = embededNodes[0];
@@ -247,15 +249,18 @@ public final class CustomizationParser {
         for (Node childNode = jaxwsBindingNode.getFirstChild();
             childNode != null;
             childNode = childNode.getNextSibling()) {
-            
-            copyJaxbAttributes(childNode, (Element)schemaNode);
-            
-            if (!isJaxbBindings(childNode)) {
+
+            if (isSchemaElement((Element)schemaNode)) {
+                copyJaxbAttributes(childNode, (Element)schemaNode);
+            }
+
+            //TODO: check for valid extension namespaces
+            if (!(childNode instanceof Element)) { //!isJaxbBindings(childNode)) {
                 continue;
             }
             
             Element childEl = (Element)childNode;
-            if (isJaxbBindingsElement(childEl)) {
+            if (isJaxbBindings(childNode) && isJaxbBindingsElement(childEl)) {
                 
                 NodeList nlist = nodeSelector.queryNodes(schemaNode, childEl.getAttribute("node"));
                 for (int i = 0; i < nlist.getLength(); i++) {
@@ -307,7 +312,7 @@ public final class CustomizationParser {
                         String pfxs = attr.getValue();
                         while (pfxs.length() > 0) {
                             String pfx = pfxs;
-                            int idx = pfx.indexOf(',');
+                            int idx = pfx.indexOf(' ');
                             if (idx != -1) {
                                 pfxs = pfxs.substring(idx + 1);
                                 pfx = pfx.substring(0, idx);
@@ -598,6 +603,11 @@ public final class CustomizationParser {
         return this.wsdlNode;
     }
 
+    private boolean isSchemaElement(Node schema) {
+        return ToolConstants.SCHEMA_URI.equals(schema.getNamespaceURI())
+               && "schema".equals(schema.getLocalName());
+    }
+
     private boolean isJAXWSBindings(Node bindings) {
         return ToolConstants.NS_JAXWS_BINDINGS.equals(bindings.getNamespaceURI())
                && "bindings".equals(bindings.getLocalName());



Mime
View raw message