diff options
Diffstat (limited to 'branches/sca-java-0.90/modules/databinding-axiom/src/main')
12 files changed, 0 insertions, 650 deletions
diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java deleted file mode 100644 index 72fc90d187..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java +++ /dev/null @@ -1,64 +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.sca.databinding.axiom;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.databinding.ExceptionHandler;
-import org.apache.tuscany.sca.databinding.WrapperHandler;
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-
-/**
- * DataBinding for AXIOM
- */
-public class AxiomDataBinding extends BaseDataBinding {
-
- public static final String NAME = OMElement.class.getName();
- public static final String[] ALIASES = new String[] {"axiom"};
-
- public AxiomDataBinding() {
- super(NAME, ALIASES, OMElement.class);
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseDataBinding#getWrapperHandler()
- */
- @Override
- public WrapperHandler getWrapperHandler() {
- return new OMElementWrapperHandler();
- }
-
- public Object copy(Object source) {
- if ( OMElement.class.isAssignableFrom(source.getClass()) ) {
- try {
- OMElement sourceElement = (OMElement)source;
- return sourceElement.cloneOMElement();
- } catch ( Exception e ) {
- throw new IllegalArgumentException(e);
- }
- }
- return super.copy(source);
- }
-
- @Override
- public ExceptionHandler getExceptionHandler() {
- return new AxiomExceptionHandler();
- }
-
-}
diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomExceptionHandler.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomExceptionHandler.java deleted file mode 100644 index dd4553fc6a..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomExceptionHandler.java +++ /dev/null @@ -1,61 +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.sca.databinding.axiom; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.databinding.ExceptionHandler; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.FaultException; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -/** - * AXIOM implementation of ExceptionHandler - * - * @version $Rev$ $Date$ - */ -public class AxiomExceptionHandler implements ExceptionHandler { - - public Exception createException(DataType<DataType> exceptionType, String message, Object faultInfo, Throwable cause) { - return new FaultException(message, (OMElement)faultInfo, cause); - } - - public Object getFaultInfo(Exception exception) { - if (exception == null) { - return null; - } - FaultException faultException = (FaultException)exception; - return faultException.getFaultInfo(); - - } - - public DataType<?> getFaultType(DataType exceptionType) { - if (FaultException.class == exceptionType.getPhysical()) { - XMLType type = XMLType.UNKNOWN; - if(exceptionType.getLogical() instanceof XMLType) { - type = (XMLType) exceptionType.getLogical(); - } - DataType<XMLType> faultType = new DataTypeImpl<XMLType>(AxiomDataBinding.NAME, OMElement.class, type); - return faultType; - } else { - return null; - } - } -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java deleted file mode 100644 index 28141cd144..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java +++ /dev/null @@ -1,64 +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.sca.databinding.axiom; - -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.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -/** - * Helper for AXIOM - * - * @version $Rev$ $Date$ - */ -public class AxiomHelper { - - private AxiomHelper() { - } - - /** - * @param context - * @param element - */ - public static void adjustElementName(TransformationContext context, OMElement element) { - if (context != null) { - DataType dataType = context.getTargetDataType(); - Object logical = dataType == null ? null : dataType.getLogical(); - if (!(logical instanceof XMLType)) { - return; - } - XMLType xmlType = (XMLType)logical; - if (xmlType.isElement() && !xmlType.getElementName().equals(element.getQName())) { - // TODO: Throw expection or switch to the new Element - OMFactory factory = OMAbstractFactory.getOMFactory(); - QName name = xmlType.getElementName(); - OMNamespace namespace = factory.createOMNamespace(name.getNamespaceURI(), name.getPrefix()); - element.setNamespace(namespace); - element.setLocalName(name.getLocalPart()); - } - } - } -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java deleted file mode 100644 index 4d2bc2b4d6..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java +++ /dev/null @@ -1,37 +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.sca.databinding.axiom; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.databinding.impl.SimpleType2JavaTransformer; - -/** - * Transformer to convert data from a simple java bject to OMElement - */ -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-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java deleted file mode 100755 index 3eb5878de3..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java +++ /dev/null @@ -1,59 +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.sca.databinding.axiom; - -import java.io.StringWriter; - -import javax.xml.stream.XMLStreamException; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -/** - * Transformer to convert data from an OMElement to XML String - */ -public class OMElement2String extends BaseTransformer<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-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java deleted file mode 100755 index c72bee62e2..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java +++ /dev/null @@ -1,47 +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.sca.databinding.axiom; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -public class OMElement2XMLStreamReader extends BaseTransformer<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-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java deleted file mode 100644 index 91d00c4c79..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java +++ /dev/null @@ -1,70 +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.sca.databinding.axiom; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -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.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.WrapperHandler; -import org.apache.tuscany.sca.interfacedef.util.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 void setChild(OMElement wrapper, int i, ElementInfo childElement, Object value) { - OMElement element = (OMElement)value; - QName elementName = childElement.getQName(); - OMNamespace namespace = factory.createOMNamespace(elementName.getNamespaceURI(), elementName.getPrefix()); - element.setNamespace(namespace); - element.setLocalName(childElement.getQName().getLocalPart()); - wrapper.addChild((OMElement)value); - } - - public List getChildren(OMElement wrapper) { - List<Object> elements = new ArrayList<Object>(); - for (Iterator i = wrapper.getChildElements(); i.hasNext();) { - elements.add(i.next()); - } - return elements; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java deleted file mode 100644 index 50ac0ecae6..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java +++ /dev/null @@ -1,52 +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.sca.databinding.axiom; - -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.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.impl.Java2SimpleTypeTransformer; - -/** - * Transformer to convert data from an simple OMElement to Java Object - */ -public class Object2OMElement extends Java2SimpleTypeTransformer<OMElement> { - - private OMFactory factory; - - public Object2OMElement() { - super(); - factory = OMAbstractFactory.getOMFactory(); - } - - protected OMElement createElement(QName element, String text, TransformationContext context) { - OMElement omElement = factory.createOMElement(element, null); - factory.createOMText(omElement, text); - return omElement; - } - - @Override - public Class getTargetType() { - return OMElement.class; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java deleted file mode 100755 index b2549029f2..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java +++ /dev/null @@ -1,57 +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.sca.databinding.axiom; - -import java.io.ByteArrayInputStream; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.impl.builder.StAXOMBuilder; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -public class String2OMElement extends BaseTransformer<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(); - AxiomHelper.adjustElementName(context, element); - return element; - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getTargetType() { - return OMElement.class; - } - - public Class getSourceType() { - return String.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java deleted file mode 100755 index ffb31aae0b..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java +++ /dev/null @@ -1,60 +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.sca.databinding.axiom; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.impl.builder.StAXOMBuilder; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -public class XMLStreamReader2OMElement extends BaseTransformer<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(); - AxiomHelper.adjustElementName(context, element); - return element; - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getTargetType() { - return OMElement.class; - } - - public Class getSourceType() { - return XMLStreamReader.class; - } - - public int getWeight() { - return 10; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/module/AxiomDataBindingModuleActivator.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/module/AxiomDataBindingModuleActivator.java deleted file mode 100644 index 8dd3cb0f51..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/module/AxiomDataBindingModuleActivator.java +++ /dev/null @@ -1,61 +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.sca.databinding.axiom.module; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.TransformerExtensionPoint; -import org.apache.tuscany.sca.databinding.axiom.AxiomDataBinding; -import org.apache.tuscany.sca.databinding.axiom.OMElement2Object; -import org.apache.tuscany.sca.databinding.axiom.OMElement2String; -import org.apache.tuscany.sca.databinding.axiom.OMElement2XMLStreamReader; -import org.apache.tuscany.sca.databinding.axiom.Object2OMElement; -import org.apache.tuscany.sca.databinding.axiom.String2OMElement; -import org.apache.tuscany.sca.databinding.axiom.XMLStreamReader2OMElement; - -/** - * Module activator for AXIOM databinding - * - * @version $Rev$ $Date$ - */ -public class AxiomDataBindingModuleActivator implements ModuleActivator { - - public Object[] getExtensionPoints() { - return null; - } - - public void start(ExtensionPointRegistry registry) { - DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class); - dataBindings.addDataBinding(new AxiomDataBinding()); - - TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class); - transformers.addTransformer(new Object2OMElement()); - transformers.addTransformer(new OMElement2Object()); - transformers.addTransformer(new OMElement2String()); - transformers.addTransformer(new OMElement2XMLStreamReader()); - transformers.addTransformer(new String2OMElement()); - transformers.addTransformer(new XMLStreamReader2OMElement()); - } - - public void stop(ExtensionPointRegistry registry) { - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-java-0.90/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index 394d11304d..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,18 +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.
-# Implementation class for the ExtensionActivator
-org.apache.tuscany.sca.databinding.axiom.module.AxiomDataBindingModuleActivator
\ No newline at end of file |