summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:13:23 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:13:23 +0000
commit6d0e93c68d3aeaeb4bb6d96ac0460eec40ef786e (patch)
treea956ed510e14a5509b8ef49fae42cfd439629825 /branches/sca-java-M2/sca/services/databinding/databinding-axiom/src
parent3ac2d800d840f03618fc364090d786effde84b1f (diff)
Moving 1.x branches
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835143 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-M2/sca/services/databinding/databinding-axiom/src')
-rw-r--r--branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/AxiomDataBinding.java48
-rw-r--r--branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java40
-rwxr-xr-xbranches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2String.java62
-rwxr-xr-xbranches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2XMLStreamReader.java50
-rw-r--r--branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java67
-rw-r--r--branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/Object2OMElement.java54
-rwxr-xr-xbranches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/String2OMElement.java88
-rwxr-xr-xbranches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/XMLStreamReader2OMElement.java90
-rw-r--r--branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/resources/META-INF/sca/databinding.axiom.scdl57
-rw-r--r--branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/resources/META-INF/sca/default.scdl56
-rwxr-xr-xbranches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/java/org/apache/tuscany/databinding/axiom/OMElementTestCase.java68
-rwxr-xr-xbranches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/ipo.xml51
-rwxr-xr-xbranches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/ipo.xsd136
-rw-r--r--branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/order.wsdl76
14 files changed, 0 insertions, 943 deletions
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/AxiomDataBinding.java b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/AxiomDataBinding.java
deleted file mode 100644
index 6a43d25847..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/AxiomDataBinding.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.databinding.axiom;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.spi.databinding.DataBinding;
-import org.apache.tuscany.spi.databinding.WrapperHandler;
-import org.apache.tuscany.spi.databinding.extension.DataBindingExtension;
-import org.osoa.sca.annotations.Service;
-
-/**
- * DataBinding for AXIOM
- */
-@Service(DataBinding.class)
-public class AxiomDataBinding extends DataBindingExtension {
-
- public static final String NAME = OMElement.class.getName();
-
- public AxiomDataBinding() {
- super(OMElement.class);
- }
-
- /**
- * @see org.apache.tuscany.spi.databinding.extension.DataBindingExtension#getWrapperHandler()
- */
- @Override
- public WrapperHandler getWrapperHandler() {
- return new OMElementWrapperHandler();
- }
-
-}
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java
deleted file mode 100644
index 91b1f4da90..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.databinding.axiom;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.spi.databinding.Transformer;
-import org.apache.tuscany.spi.databinding.extension.SimpleType2JavaTransformer;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Transformer to convert data from a simple java bject to OMElement
- */
-@Service(Transformer.class)
-public class OMElement2Object extends SimpleType2JavaTransformer<OMElement> {
-
- @Override
- protected String getText(OMElement source) {
- return source.getText();
- }
-
- public Class getSourceType() {
- return OMElement.class;
- }
-}
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2String.java b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2String.java
deleted file mode 100755
index 52be08537d..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2String.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.databinding.axiom;
-
-import java.io.StringWriter;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.spi.databinding.PullTransformer;
-import org.apache.tuscany.spi.databinding.TransformationContext;
-import org.apache.tuscany.spi.databinding.TransformationException;
-import org.apache.tuscany.spi.databinding.Transformer;
-import org.apache.tuscany.spi.databinding.extension.TransformerExtension;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Transformer to convert data from an OMElement to XML String
- */
-@Service(Transformer.class)
-public class OMElement2String extends TransformerExtension<OMElement, String> implements PullTransformer<OMElement, String> {
- // private XmlOptions options;
-
- public String transform(OMElement source, TransformationContext context) {
- try {
- StringWriter writer = new StringWriter();
- source.serialize(writer);
- return writer.toString();
- } catch (XMLStreamException e) {
- throw new TransformationException(e);
- }
- }
-
- public Class getSourceType() {
- return OMElement.class;
- }
-
- public Class getTargetType() {
- return String.class;
- }
-
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2XMLStreamReader.java b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2XMLStreamReader.java
deleted file mode 100755
index 343408a027..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2XMLStreamReader.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.databinding.axiom;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.spi.databinding.PullTransformer;
-import org.apache.tuscany.spi.databinding.TransformationContext;
-import org.apache.tuscany.spi.databinding.Transformer;
-import org.apache.tuscany.spi.databinding.extension.TransformerExtension;
-import org.osoa.sca.annotations.Service;
-
-@Service(Transformer.class)
-public class OMElement2XMLStreamReader extends TransformerExtension<OMElement, XMLStreamReader> implements PullTransformer<OMElement, XMLStreamReader> {
- // private XmlOptions options;
-
- public XMLStreamReader transform(OMElement source, TransformationContext context) {
- return source.getXMLStreamReader();
- }
-
- public Class getSourceType() {
- return OMElement.class;
- }
-
- public Class getTargetType() {
- return XMLStreamReader.class;
- }
-
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java
deleted file mode 100644
index 0ba2863735..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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.databinding.axiom;
-
-import java.util.Iterator;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.tuscany.spi.databinding.TransformationContext;
-import org.apache.tuscany.spi.databinding.WrapperHandler;
-import org.apache.tuscany.spi.idl.ElementInfo;
-
-/**
- * OMElement wrapper handler implementation
- */
-public class OMElementWrapperHandler implements WrapperHandler<OMElement> {
-
- private OMFactory factory;
-
- public OMElementWrapperHandler() {
- super();
- this.factory = OMAbstractFactory.getOMFactory();
- }
-
- public OMElement create(ElementInfo element, TransformationContext context) {
- OMElement wrapper = factory.createOMElement(element.getQName(), null);
- return wrapper;
- }
-
- public Object getChild(OMElement wrapper, int i, ElementInfo element) {
- int index = 0;
- for (Iterator e = wrapper.getChildElements(); e.hasNext();) {
- OMElement child = (OMElement) e.next();
- if (index != i) {
- index++;
- continue;
- }
- if (child.getQName().equals(element.getQName())) {
- return child;
- }
- }
- return null;
- }
-
- public void setChild(OMElement wrapper, int i, ElementInfo childElement, Object value) {
- wrapper.addChild((OMElement) value);
- }
-
-}
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/Object2OMElement.java b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/Object2OMElement.java
deleted file mode 100644
index 5416b5239e..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/Object2OMElement.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.databinding.axiom;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.tuscany.spi.databinding.TransformationContext;
-import org.apache.tuscany.spi.databinding.Transformer;
-import org.apache.tuscany.spi.databinding.extension.Java2SimpleTypeTransformer;
-import org.apache.tuscany.spi.idl.ElementInfo;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Transformer to convert data from an simple OMElement to Java Object
- */
-@Service(Transformer.class)
-public class Object2OMElement extends Java2SimpleTypeTransformer<OMElement> {
-
- private OMFactory factory;
-
- public Object2OMElement() {
- super();
- factory = OMAbstractFactory.getOMFactory();
- }
-
- protected OMElement createElement(ElementInfo element, String text, TransformationContext context) {
- OMElement omElement = factory.createOMElement(element.getQName(), null);
- factory.createOMText(omElement, text);
- return omElement;
- }
-
- @Override
- public Class getTargetType() {
- return OMElement.class;
- }
-
-}
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/String2OMElement.java b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/String2OMElement.java
deleted file mode 100755
index 59ac5423d7..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/String2OMElement.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.databinding.axiom;
-
-import java.io.ByteArrayInputStream;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.tuscany.spi.databinding.PullTransformer;
-import org.apache.tuscany.spi.databinding.TransformationContext;
-import org.apache.tuscany.spi.databinding.TransformationException;
-import org.apache.tuscany.spi.databinding.Transformer;
-import org.apache.tuscany.spi.databinding.extension.TransformerExtension;
-import org.apache.tuscany.spi.model.DataType;
-import org.osoa.sca.annotations.Service;
-
-@Service(Transformer.class)
-public class String2OMElement extends TransformerExtension<String, OMElement> implements
- PullTransformer<String, OMElement> {
-
- @SuppressWarnings("unchecked")
- public OMElement transform(String source, TransformationContext context) {
- try {
- StAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(source.getBytes()));
- OMElement element = builder.getDocumentElement();
- adjustElementName(context, element);
- return element;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- /**
- * @param context
- * @param element
- */
- private void adjustElementName(TransformationContext context, OMElement element) {
- if (context != null) {
- DataType dataType = context.getTargetDataType();
- Object targetQName = dataType == null ? null : dataType.getLogical();
- if (!(targetQName instanceof QName)) {
- return;
- }
- if (!element.getQName().equals(targetQName)) {
- // TODO: Throw expection or switch to the new Element
- OMFactory factory = OMAbstractFactory.getOMFactory();
- QName name = (QName)targetQName;
- OMNamespace namespace = factory.createOMNamespace(name.getNamespaceURI(), name.getPrefix());
- element.setNamespace(namespace);
- element.setLocalName(name.getLocalPart());
- }
- }
- }
-
- public Class getTargetType() {
- return OMElement.class;
- }
-
- public Class getSourceType() {
- return String.class;
- }
-
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/XMLStreamReader2OMElement.java b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/XMLStreamReader2OMElement.java
deleted file mode 100755
index 5b2c89b443..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/XMLStreamReader2OMElement.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.databinding.axiom;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.tuscany.spi.databinding.PullTransformer;
-import org.apache.tuscany.spi.databinding.TransformationContext;
-import org.apache.tuscany.spi.databinding.TransformationException;
-import org.apache.tuscany.spi.databinding.Transformer;
-import org.apache.tuscany.spi.databinding.extension.TransformerExtension;
-import org.apache.tuscany.spi.model.DataType;
-import org.osoa.sca.annotations.Service;
-
-@Service(Transformer.class)
-public class XMLStreamReader2OMElement extends TransformerExtension<XMLStreamReader, OMElement> implements
- PullTransformer<XMLStreamReader, OMElement> {
-
- public XMLStreamReader2OMElement() {
- super();
- }
-
- public OMElement transform(XMLStreamReader source, TransformationContext context) {
- try {
- StAXOMBuilder builder = new StAXOMBuilder(source);
- OMElement element = builder.getDocumentElement();
- adjustElementName(context, element);
- return element;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- /**
- * @param context
- * @param element
- */
- private void adjustElementName(TransformationContext context, OMElement element) {
- if (context != null) {
- DataType dataType = context.getTargetDataType();
- Object targetQName = dataType == null ? null : dataType.getLogical();
- if (!(targetQName instanceof QName)) {
- return;
- }
- if (!element.getQName().equals(targetQName)) {
- // TODO: Throw expection or switch to the new Element
- OMFactory factory = OMAbstractFactory.getOMFactory();
- QName name = (QName)targetQName;
- OMNamespace namespace = factory.createOMNamespace(name.getNamespaceURI(), name.getPrefix());
- element.setNamespace(namespace);
- element.setLocalName(name.getLocalPart());
- }
- }
- }
-
- public Class getTargetType() {
- return OMElement.class;
- }
-
- public Class getSourceType() {
- return XMLStreamReader.class;
- }
-
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/resources/META-INF/sca/databinding.axiom.scdl b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/resources/META-INF/sca/databinding.axiom.scdl
deleted file mode 100644
index 0954b5a90f..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/resources/META-INF/sca/databinding.axiom.scdl
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<!-- This is the copy ot be included by other extensions -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:system="http://incubator.apache.org/tuscany/xmlns/system/1.0-incubator-M2"
- name="org.apache.tuscany.databinding.axiom.include">
-
- <dependency xmlns="http://incubator.apache.org/tuscany/xmlns/1.0-incubator-M2">
- <group>org.apache.tuscany.sca.services.databinding</group>
- <name>databinding-axiom</name>
- <version>1.0-incubator-M2-SNAPSHOT</version>
- </dependency>
-
- <component name="databinding.axiom">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.AxiomDataBinding" />
- </component>
-
- <component name="transformer.XMLStreamReader2OMElement">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.XMLStreamReader2OMElement" />
- </component>
-
- <component name="transformer.OMElement2XMLStreamReader">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.OMElement2XMLStreamReader" />
- </component>
-
- <component name="transformer.String2OMElement">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.String2OMElement" />
- </component>
-
- <component name="transformer.OMElement2String">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.OMElement2String" />
- </component>
-
- <component name="transformer.Object2OMElement">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.Object2OMElement" />
- </component>
-
- <component name="transformer.OMElement2Object">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.OMElement2Object" />
- </component>
-</composite> \ No newline at end of file
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/resources/META-INF/sca/default.scdl
deleted file mode 100644
index 25e5a04c5c..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/main/resources/META-INF/sca/default.scdl
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:system="http://incubator.apache.org/tuscany/xmlns/system/1.0-incubator-M2"
- name="org.apache.tuscany.databinding.axiom">
-
- <dependency xmlns="http://incubator.apache.org/tuscany/xmlns/1.0-incubator-M2">
- <group>org.apache.tuscany.sca.services.databinding</group>
- <name>databinding-axiom</name>
- <version>1.0-incubator-M2-SNAPSHOT</version>
- </dependency>
-
- <component name="databinding.axiom">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.AxiomDataBinding" />
- </component>
-
- <component name="transformer.XMLStreamReader2OMElement">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.XMLStreamReader2OMElement" />
- </component>
-
- <component name="transformer.OMElement2XMLStreamReader">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.OMElement2XMLStreamReader" />
- </component>
-
- <component name="transformer.String2OMElement">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.String2OMElement" />
- </component>
-
- <component name="transformer.OMElement2String">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.OMElement2String" />
- </component>
-
- <component name="transformer.Object2OMElement">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.Object2OMElement" />
- </component>
-
- <component name="transformer.OMElement2Object">
- <system:implementation.system class="org.apache.tuscany.databinding.axiom.OMElement2Object" />
- </component>
-</composite> \ No newline at end of file
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/java/org/apache/tuscany/databinding/axiom/OMElementTestCase.java b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/java/org/apache/tuscany/databinding/axiom/OMElementTestCase.java
deleted file mode 100755
index 5a2793225b..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/java/org/apache/tuscany/databinding/axiom/OMElementTestCase.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.databinding.axiom;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMElement;
-
-public class OMElementTestCase extends TestCase {
- private static final String IPO_XML =
- "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder"
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
- + " xmlns:ipo=\"http://www.example.com/IPO\""
- + " xsi:schemaLocation=\"http://www.example.com/IPO ipo.xsd\"" + " orderDate=\"1999-12-01\">"
- + " <shipTo exportCode=\"1\" xsi:type=\"ipo:UKAddress\">" + " <name>Helen Zoe</name>"
- + " <street>47 Eden Street</street>" + " <city>Cambridge</city>"
- + " <postcode>CB1 1JR</postcode>" + " </shipTo>" + " <billTo xsi:type=\"ipo:USAddress\">"
- + " <name>Robert Smith</name>" + " <street>8 Oak Avenue</street>"
- + " <city>Old Town</city>" + " <state>PA</state>" + " <zip>95819</zip>" + " </billTo>"
- + " <items>" + " <item partNum=\"833-AA\">" + " <productName>Lapis necklace</productName>"
- + " <quantity>1</quantity>" + " <USPrice>99.95</USPrice>"
- + " <ipo:comment>Want this for the holidays</ipo:comment>"
- + " <shipDate>1999-12-05</shipDate>" + " </item>" + " </items>" + "</ipo:purchaseOrder>";
-
- public final void testStringTransform() {
- String2OMElement t1 = new String2OMElement();
- OMElement element = t1.transform(IPO_XML, null);
- OMElement2String t2 = new OMElement2String();
- String xml = t2.transform(element, null);
- Assert.assertNotNull(xml);
- Assert.assertNotNull(xml.indexOf("<ipo:comment>") != -1);
- }
-
- public final void testStAXTransform() {
- String2OMElement t1 = new String2OMElement();
- OMElement element = t1.transform(IPO_XML, null);
-
- OMElement2XMLStreamReader t2 = new OMElement2XMLStreamReader();
- XMLStreamReader reader = t2.transform(element, null);
-
- XMLStreamReader2OMElement t3 = new XMLStreamReader2OMElement();
- OMElement element2 = t3.transform(reader, null);
-
- Assert.assertEquals(element2.getQName(), element.getQName());
- Assert.assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), element2.getQName());
- }
-
-}
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/ipo.xml b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/ipo.xml
deleted file mode 100755
index df901d183d..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/ipo.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * 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.
--->
-<ipo:purchaseOrder
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ipo="http://www.example.com/IPO"
- xsi:schemaLocation="http://www.example.com/IPO ipo.xsd"
- orderDate="1999-12-01">
-
- <shipTo exportCode="1" xsi:type="ipo:UKAddress">
- <name>Helen Zoe</name>
- <street>47 Eden Street</street>
- <city>Cambridge</city>
- <postcode>CB1 1JR</postcode>
- </shipTo>
-
- <billTo xsi:type="ipo:USAddress">
- <name>Robert Smith</name>
- <street>8 Oak Avenue</street>
- <city>Old Town</city>
- <state>PA</state>
- <zip>95819</zip>
- </billTo>
-
- <items>
- <item partNum="833-AA">
- <productName>Lapis necklace</productName>
- <quantity>1</quantity>
- <USPrice>99.95</USPrice>
- <ipo:comment>Want this for the holidays</ipo:comment>
- <shipDate>1999-12-05</shipDate>
- </item>
- </items>
-</ipo:purchaseOrder>
-
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/ipo.xsd b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/ipo.xsd
deleted file mode 100755
index 241ec15d36..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/ipo.xsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<!--
- * 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.
--->
-<schema targetNamespace="http://www.example.com/IPO"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ipo="http://www.example.com/IPO">
-
- <annotation>
- <documentation xml:lang="en">
- International Purchase order schema for Example.com
- Copyright 2000 Example.com. All rights reserved.
- </documentation>
- </annotation>
-
-
- <element name="purchaseOrder" type="ipo:PurchaseOrderType" />
-
- <element name="comment" type="string" />
-
- <complexType name="PurchaseOrderType">
- <sequence>
- <element name="shipTo" type="ipo:Address" />
- <element name="billTo" type="ipo:Address" />
- <element ref="ipo:comment" minOccurs="0" />
- <element name="items" type="ipo:Items" />
- </sequence>
- <attribute name="orderDate" type="date" />
- </complexType>
-
- <complexType name="Items">
- <sequence>
- <element name="item" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <sequence>
- <element name="productName" type="string" />
- <element name="quantity">
- <simpleType>
- <restriction base="positiveInteger">
- <maxExclusive value="100" />
- </restriction>
- </simpleType>
- </element>
- <element name="USPrice" type="decimal" />
- <element ref="ipo:comment" minOccurs="0" />
- <element name="shipDate" type="date"
- minOccurs="0" />
- </sequence>
- <attribute name="partNum" type="ipo:SKU"
- use="required" />
- </complexType>
- </element>
- </sequence>
- </complexType>
-
- <simpleType name="SKU">
- <restriction base="string">
- <pattern value="\d{3}-[A-Z]{2}" />
- </restriction>
- </simpleType>
-
- <complexType name="Address">
- <sequence>
- <element name="name" type="string" />
- <element name="street" type="string" />
- <element name="city" type="string" />
- </sequence>
- </complexType>
-
- <complexType name="USAddress">
- <complexContent>
- <extension base="ipo:Address">
- <sequence>
- <element name="state" type="ipo:USState" />
- <element name="zip" type="positiveInteger" />
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="UKAddress">
- <complexContent>
- <extension base="ipo:Address">
- <sequence>
- <element name="postcode" type="ipo:UKPostcode" />
- </sequence>
- <attribute name="exportCode" type="positiveInteger"
- fixed="1" />
- </extension>
- </complexContent>
- </complexType>
-
- <!-- other Address derivations for more countries -->
-
- <simpleType name="USState">
- <restriction base="string">
- <enumeration value="AK" />
- <enumeration value="AL" />
- <enumeration value="AR" />
- <enumeration value="CA" />
- <enumeration value="PA" />
- <!-- and so on ... -->
- </restriction>
- </simpleType>
-
- <simpleType name="Postcode">
- <restriction base="string">
- <length value="7" fixed="true" />
- </restriction>
- </simpleType>
-
-
- <simpleType name="UKPostcode">
- <restriction base="ipo:Postcode">
- <pattern value="[A-Z]{2}\d\s\d[A-Z]{2}" />
- </restriction>
- </simpleType>
-
-
-
-</schema>
-
diff --git a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/order.wsdl b/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/order.wsdl
deleted file mode 100644
index 7634cdebd3..0000000000
--- a/branches/sca-java-M2/sca/services/databinding/databinding-axiom/src/test/resources/order.wsdl
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * 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.
--->
-<definitions name="StockQuote" targetNamespace="http://example.com/order.wsdl" xmlns:tns="http://example.com/order.wsdl"
- xmlns:xsd1="http://example.com/order.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema targetNamespace="http://example.com/order.xsd" xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ipo="http://www.example.com/IPO">
- <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd"/>
- <element name="checkOrderStatus">
- <complexType>
- <sequence>
- <element name="customerId" type="string" />
- <element name="order" type="ipo:PurchaseOrderType" />
- <element name="flag" type="int" />
- </sequence>
- </complexType>
- </element>
- <element name="checkOrderStatusResponse">
- <complexType>
- <sequence>
- <element name="status" type="string" />
- </sequence>
- </complexType>
- </element>
- <element name="note" type="string" />
- </schema>
- </types>
-
- <message name="CheckOrderStatusInput1">
- <part name="body" element="xsd1:checkOrderStatus" />
- </message>
-
- <message name="CheckOrderStatusOutput1">
- <part name="body" element="xsd1:checkOrderStatusResponse" />
- </message>
-
- <message name="CheckOrderStatusInput2">
- <part name="p1" element="xsd1:checkOrderStatus" />
- <part name="p2" element="xsd1:note" />
- </message>
-
- <message name="CheckOrderStatusOutput2">
- <part name="p1" element="xsd1:checkOrderStatusResponse" />
- </message>
-
- <portType name="OrderPortType">
- <operation name="checkOrderStatus">
- <input message="tns:CheckOrderStatusInput1" />
- <output message="tns:CheckOrderStatusOutput1" />
- </operation>
- <operation name="checkOrderStatus2">
- <input message="tns:CheckOrderStatusInput2" />
- <output message="tns:CheckOrderStatusOutput2" />
- </operation>
- </portType>
-
-</definitions>