diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-27 00:57:04 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-27 00:57:04 +0000 |
commit | b4f69551cb9d3f2369f194df236c883aba463f4c (patch) | |
tree | 74c91db6521e0d49641dd5e1823bfb70e4aef12c /java/sca/modules/interface-wsdl/src | |
parent | 1b813c3c53f3639f076fae20dfeb8a84a862ae9d (diff) |
Refactor the XMLInputFactory.newInstance into FactoryExtensionPoint.getFactory
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@778939 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/interface-wsdl/src')
2 files changed, 23 insertions, 22 deletions
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java index ab6467bfd7..2df0f0c3a1 100644 --- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java +++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java @@ -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.WrapperInfo; 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 @@ import org.apache.ws.commons.schema.XmlSchemaType; /** * Metadata for a WSDL operation - * + * * @version $Rev$ $Date$ */ public class WSDLOperationIntrospectorImpl { @@ -105,7 +104,7 @@ public class WSDLOperationIntrospectorImpl { /** * 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 @@ public class WSDLOperationIntrospectorImpl { } if (element.isNillable()) { // Wrapper element cannot be nillable - return null; + // return null; } XmlSchemaType type = element.getSchemaType(); if (type == null) { @@ -427,7 +426,7 @@ public class WSDLOperationIntrospectorImpl { /** * 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 @@ public class WSDLOperationIntrospectorImpl { } 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 @@ public class WSDLOperationIntrospectorImpl { /** * 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 @@ public class WSDLOperationIntrospectorImpl { } 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? diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java index 2c4dbf45d8..c169214e44 100644 --- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java +++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java @@ -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 @@ import org.apache.tuscany.sca.xsd.XSDefinition; /**
* 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 class WSDLDocumentProcessor implements URLArtifactProcessor<WSDLDefinitio 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 class WSDLDocumentProcessor implements URLArtifactProcessor<WSDLDefinitio 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 @@ public class WSDLDocumentProcessor implements URLArtifactProcessor<WSDLDefinitio 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 class WSDLDocumentProcessor implements URLArtifactProcessor<WSDLDefinitio 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 @@ public class WSDLDocumentProcessor implements URLArtifactProcessor<WSDLDefinitio /**
* Read the namespace for the WSDL definition and inline schemas
- *
+ *
* @param doc
* @return
* @throws IOException
|