diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-13 05:50:20 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-13 05:50:20 +0000 |
commit | e84e7c3249d63d21fb281f078fb8ff1fed8a5305 (patch) | |
tree | f03eb81693f70419852ab0cf5092a942dd3f65a7 | |
parent | ca00774aed1b5ecd2e58667e4452209a63813cce (diff) |
Add DOM/AXIOM databindings
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@793463 13f79535-47bb-0310-9956-ffa450edef68
4 files changed, 157 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/tools/databinding/sdo/src/main/java/org/apache/tuscany/tools/wsdl2java/axiom/AXIOMDataBinding.java b/branches/sca-java-1.x/tools/databinding/sdo/src/main/java/org/apache/tuscany/tools/wsdl2java/axiom/AXIOMDataBinding.java new file mode 100644 index 0000000000..d2a6523002 --- /dev/null +++ b/branches/sca-java-1.x/tools/databinding/sdo/src/main/java/org/apache/tuscany/tools/wsdl2java/axiom/AXIOMDataBinding.java @@ -0,0 +1,57 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.tools.wsdl2java.axiom;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.DefaultValueWriter;
+import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
+
+/**
+ *
+ */
+public class AXIOMDataBinding implements DataBindingProfile {
+ private static final String OM_ELEMENT = "org.apache.axis2.om.OMElement";
+
+ public DefaultValueWriter createDefaultValueWriter(QName qn, boolean element) {
+ return null;
+ }
+
+ public DefaultValueWriter createDefaultValueWriterForWrappedElement(QName wrapperElement, QName qn) {
+ return null;
+ }
+
+ public void generate(ToolContext context) throws ToolException {
+ }
+
+ public String getType(QName qn, boolean element) {
+ return OM_ELEMENT;
+ }
+
+ public String getWrappedElementType(QName wrapperElement, QName item) {
+ return OM_ELEMENT;
+ }
+
+ public void initialize(ToolContext c) throws ToolException {
+ }
+
+}
diff --git a/branches/sca-java-1.x/tools/databinding/sdo/src/main/java/org/apache/tuscany/tools/wsdl2java/dom/DOMDataBinding.java b/branches/sca-java-1.x/tools/databinding/sdo/src/main/java/org/apache/tuscany/tools/wsdl2java/dom/DOMDataBinding.java new file mode 100644 index 0000000000..c668d59db5 --- /dev/null +++ b/branches/sca-java-1.x/tools/databinding/sdo/src/main/java/org/apache/tuscany/tools/wsdl2java/dom/DOMDataBinding.java @@ -0,0 +1,58 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.tools.wsdl2java.dom;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.DefaultValueWriter;
+import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
+
+/**
+ *
+ */
+public class DOMDataBinding implements DataBindingProfile {
+
+ private static final String DOM_ELEMENT = "org.w3c.dom.Element";
+
+ public DefaultValueWriter createDefaultValueWriter(QName qn, boolean element) {
+ return null;
+ }
+
+ public DefaultValueWriter createDefaultValueWriterForWrappedElement(QName wrapperElement, QName qn) {
+ return null;
+ }
+
+ public void generate(ToolContext context) throws ToolException {
+ }
+
+ public String getType(QName qn, boolean element) {
+ return DOM_ELEMENT;
+ }
+
+ public String getWrappedElementType(QName wrapperElement, QName item) {
+ return DOM_ELEMENT;
+ }
+
+ public void initialize(ToolContext c) throws ToolException {
+ }
+
+}
diff --git a/branches/sca-java-1.x/tools/databinding/sdo/src/main/resources/META-INF/tools-plugin.xml b/branches/sca-java-1.x/tools/databinding/sdo/src/main/resources/META-INF/tools-plugin.xml index abcdeb0f7c..814c6c93b6 100644 --- a/branches/sca-java-1.x/tools/databinding/sdo/src/main/resources/META-INF/tools-plugin.xml +++ b/branches/sca-java-1.x/tools/databinding/sdo/src/main/resources/META-INF/tools-plugin.xml @@ -20,4 +20,6 @@ <plugin name="sdo" version="" provider="tuscany.apache.org" xmlns="http://cxf.apache.org/tools/plugin">
<databinding name="sdo" package="org.apache.tuscany.tools.wsdl2java.sdo" profile="SDODatabinding" />
<databinding name="static-sdo" package="org.apache.tuscany.tools.wsdl2java.sdo" profile="SDODatabinding" />
+ <databinding name="dom" package="org.apache.tuscany.tools.wsdl2java.dom" profile="DOMDataBinding" />
+ <databinding name="axiom" package="org.apache.tuscany.tools.wsdl2java.axiom" profile="AXIOMDataBinding" />
</plugin>
\ No newline at end of file diff --git a/branches/sca-java-1.x/tools/databinding/sdo/src/test/java/org/apache/tuscany/tools/wsdl2java/dom/DOMDataBindingTestCase.java b/branches/sca-java-1.x/tools/databinding/sdo/src/test/java/org/apache/tuscany/tools/wsdl2java/dom/DOMDataBindingTestCase.java new file mode 100644 index 0000000000..95c5a979dd --- /dev/null +++ b/branches/sca-java-1.x/tools/databinding/sdo/src/test/java/org/apache/tuscany/tools/wsdl2java/dom/DOMDataBindingTestCase.java @@ -0,0 +1,40 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.tools.wsdl2java.dom;
+
+import java.net.URL;
+
+import org.apache.cxf.tools.wsdlto.WSDLToJava;
+import org.junit.Test;
+
+/**
+ *
+ */
+public class DOMDataBindingTestCase {
+
+ @Test
+ public void testGenerateDynamic() {
+ URL url = getClass().getResource("/HelloService.wsdl");
+ String args[] = new String[] {"-db", "dom", "-d", "target/jaxws-dom-source", url.toString()};
+ WSDLToJava.main(args);
+
+ }
+
+}
|