You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2009/05/27 02:57:04 UTC

svn commit: r778939 - in /tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl: impl/WSDLOperationIntrospectorImpl.java xml/WSDLDocumentProcessor.java

Author: rfeng
Date: Wed May 27 00:57:04 2009
New Revision: 778939

URL: http://svn.apache.org/viewvc?rev=778939&view=rev
Log:
Refactor the XMLInputFactory.newInstance into FactoryExtensionPoint.getFactory

Modified:
    tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java
    tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java

Modified: tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java?rev=778939&r1=778938&r2=778939&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java (original)
+++ tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java Wed May 27 00:57:04 2009
@@ -6,15 +6,15 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.tuscany.sca.interfacedef.wsdl.impl;
@@ -46,9 +46,8 @@
 import org.apache.tuscany.sca.interfacedef.util.XMLType;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
-import org.apache.tuscany.sca.xsd.XSDefinition;
 import org.apache.tuscany.sca.xsd.XSDFactory;
-
+import org.apache.tuscany.sca.xsd.XSDefinition;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaObject;
@@ -60,7 +59,7 @@
 
 /**
  * Metadata for a WSDL operation
- * 
+ *
  * @version $Rev$ $Date$
  */
 public class WSDLOperationIntrospectorImpl {
@@ -105,7 +104,7 @@
     /**
      * Test if the operation qualifies wrapper style as defined by the JAX-WS
      * 2.0 Specification
-     * 
+     *
      * @return true if the operation qualifies wrapper style, otherwise false
      */
     public boolean isWrapperStyle() throws InvalidWSDLException {
@@ -360,7 +359,7 @@
             }
             if (element.isNillable()) {
                 // Wrapper element cannot be nillable
-                return null;
+                // return null;
             }
             XmlSchemaType type = element.getSchemaType();
             if (type == null) {
@@ -427,7 +426,7 @@
 
         /**
          * Return a list of child XSD elements under the wrapped request element
-         * 
+         *
          * @return a list of child XSD elements or null if if the request
          *         element is not wrapped
          */
@@ -457,7 +456,8 @@
                 }
                 if (inputWrapperElement.isNillable()) {
                     // The wrapper element cannot be nilable
-                    return null;
+                    // FIXME: Java2WSDL create nillable
+                    // return null;
                 }
                 inputElements = getChildElements(inputWrapperElement);
                 return inputElements;
@@ -469,7 +469,7 @@
         /**
          * Return a list of child XSD elements under the wrapped response
          * element
-         * 
+         *
          * @return a list of child XSD elements or null if if the response
          *         element is not wrapped
          */
@@ -495,7 +495,7 @@
                 }
                 if (outputWrapperElement.isNillable()) {
                     // The wrapper element cannot be nilable
-                    return null;
+                    // return null;
                 }
                 outputElements = getChildElements(outputWrapperElement);
                 // FIXME: Do we support multiple child elements for the response?

Modified: tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java?rev=778939&r1=778938&r2=778939&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java (original)
+++ tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java Wed May 27 00:57:04 2009
@@ -6,15 +6,15 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.tuscany.sca.interfacedef.wsdl.xml;
@@ -48,7 +48,7 @@
 
 /**
  * An ArtifactProcessor for WSDL documents.
- * 
+ *
  * @version $Rev: 709339 $ $Date: 2008-10-31 04:01:44 +0000 (Fri, 31 Oct 2008) $
  */
 public class WSDLDocumentProcessor implements URLArtifactProcessor<WSDLDefinition> {
@@ -57,7 +57,7 @@
     public static final QName WSDL11_IMPORT = new QName("http://schemas.xmlsoap.org/wsdl/", "import");
     public static final QName XSD = new QName("http://www.w3.org/2001/XMLSchema", "schema");
 
-    private static final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+    private XMLInputFactory inputFactory;
 
     private WSDLFactory factory;
     private XSDFactory xsdFactory;
@@ -66,12 +66,13 @@
     public WSDLDocumentProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
         this.factory = modelFactories.getFactory(WSDLFactory.class);
         this.xsdFactory = modelFactories.getFactory(XSDFactory.class);
+        this.inputFactory = modelFactories.getFactory(XMLInputFactory.class);
         this.monitor = monitor;
     }
-    
+
     /**
      * Report a exception.
-     * 
+     *
      * @param problems
      * @param message
      * @param model
@@ -80,7 +81,7 @@
     	 if (monitor != null) {
     		 Problem problem = monitor.createProblem(this.getClass().getName(), "interface-wsdlxml-validation-messages", Severity.ERROR, model, message, ex);
     	     monitor.problem(problem);
-    	 }        
+    	 }
      }
 
     public WSDLDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException {
@@ -98,7 +99,7 @@
 
     public void resolve(WSDLDefinition model, ModelResolver resolver) throws ContributionResolveException {
         if (model == null) return;
-    	
+
         Definition definition = model.getDefinition();
         if (definition != null) {
             for (Object imports : definition.getImports().values()) {
@@ -179,7 +180,7 @@
 
     /**
      * Read the namespace for the WSDL definition and inline schemas
-     * 
+     *
      * @param doc
      * @return
      * @throws IOException