From 734d1d84e2b097d334bf57331f14af0ee250ca0c Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 14 Jan 2009 18:40:38 +0000 Subject: Reverting changes from revision #734356 and there was some merge conflicts that were not supposed to get to svn. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@734475 13f79535-47bb-0310-9956-ffa450edef68 --- .../processor/xml/AnyAttributeProcessor.java | 20 ++++----- .../processor/xml/AnyAttributeWrapper.java | 48 ---------------------- .../processor/xml/AnyElementProcessor.java | 13 ++++-- ...a.contribution.processor.StAXAttributeProcessor | 19 --------- 4 files changed, 19 insertions(+), 81 deletions(-) delete mode 100644 branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeWrapper.java delete mode 100644 branches/sca-java-1.x/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor (limited to 'branches/sca-java-1.x/modules/contribution-xml') diff --git a/branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java b/branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java index 04431f7eab..36e959ea21 100644 --- a/branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java +++ b/branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java @@ -38,7 +38,7 @@ import org.apache.tuscany.sca.monitor.Monitor; * * @version $Rev$ $Date$ */ -public class AnyAttributeProcessor extends BaseStAXArtifactProcessor implements StAXAttributeProcessor { +public class AnyAttributeProcessor extends BaseStAXArtifactProcessor implements StAXAttributeProcessor { private static final QName ANY_ATTRIBUTE = new QName(Constants.XMLSCHEMA_NS, "anyAttribute"); public AnyAttributeProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) { @@ -49,23 +49,21 @@ public class AnyAttributeProcessor extends BaseStAXArtifactProcessor implements return ANY_ATTRIBUTE; } - public Class getModelType() { - return AnyAttributeWrapper.class; + public Class getModelType() { + return String.class; } - public AnyAttributeWrapper read(QName attributeName, XMLStreamReader reader) throws ContributionReadException, XMLStreamException { - AnyAttributeWrapper attributeWrapper = new AnyAttributeWrapper(); - attributeWrapper.setQName(attributeName); - attributeWrapper.setValue(reader.getAttributeValue(attributeName.getNamespaceURI(), attributeName.getLocalPart())); - return attributeWrapper; + public String read(QName attributeName, XMLStreamReader reader) throws ContributionReadException, XMLStreamException { + return reader.getAttributeValue(attributeName.getNamespaceURI(), attributeName.getLocalPart()); } - public void write(AnyAttributeWrapper attributeWrapper, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException { - writer.writeAttribute(attributeWrapper.getQName().getPrefix(), attributeWrapper.getQName().getNamespaceURI(), attributeWrapper.getQName().getLocalPart(), attributeWrapper.getValue().toString()); + public void write(String value, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException { + writer.setPrefix(ANY_ATTRIBUTE.getPrefix(), ANY_ATTRIBUTE.getNamespaceURI()); + writer.writeAttribute(ANY_ATTRIBUTE.getLocalPart(), value); } - public void resolve(AnyAttributeWrapper arg0, ModelResolver arg1) throws ContributionResolveException { + public void resolve(String arg0, ModelResolver arg1) throws ContributionResolveException { } } diff --git a/branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeWrapper.java b/branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeWrapper.java deleted file mode 100644 index 16c01755fc..0000000000 --- a/branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeWrapper.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.sca.contribution.processor.xml; - -import javax.xml.namespace.QName; - -public class AnyAttributeWrapper { - private QName qName; - private Object value; - - public AnyAttributeWrapper() { - - } - - public AnyAttributeWrapper(QName qName, Object value) { - this.qName = qName; - this.value = value; - } - - public QName getQName() { - return qName; - } - public void setQName(QName name) { - qName = name; - } - public Object getValue() { - return value; - } - public void setValue(Object value) { - this.value = value; - } -} diff --git a/branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyElementProcessor.java b/branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyElementProcessor.java index 5e4462ef08..2b868b9e45 100644 --- a/branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyElementProcessor.java +++ b/branches/sca-java-1.x/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyElementProcessor.java @@ -18,23 +18,28 @@ */ package org.apache.tuscany.sca.contribution.processor.xml; -import static javax.xml.stream.XMLStreamConstants.CDATA; -import static javax.xml.stream.XMLStreamConstants.CHARACTERS; import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; +import static javax.xml.stream.XMLStreamConstants.CHARACTERS; +import static javax.xml.stream.XMLStreamConstants.COMMENT; +import static javax.xml.stream.XMLStreamConstants.CDATA; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Stack; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import javax.xml.stream.XMLEventReader; import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; +import javax.xml.stream.events.Characters; import javax.xml.stream.events.XMLEvent; import org.apache.tuscany.sca.contribution.Constants; @@ -44,9 +49,11 @@ import org.apache.tuscany.sca.contribution.resolver.ModelResolver; import org.apache.tuscany.sca.contribution.service.ContributionReadException; import org.apache.tuscany.sca.contribution.service.ContributionResolveException; import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.contribution.processor.xml.XMLEventsStreamReader; public class AnyElementProcessor implements StAXArtifactProcessor { - private static final QName ANY_ELEMENT = new QName(Constants.XMLSCHEMA_NS, "anyElement"); + private static final QName ANY_ELEMENT = new QName(Constants.XMLSCHEMA_NS, + "anyElement"); private XMLInputFactory xmlInputFactory; @SuppressWarnings("unused") diff --git a/branches/sca-java-1.x/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor b/branches/sca-java-1.x/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor deleted file mode 100644 index e3d5e16ef6..0000000000 --- a/branches/sca-java-1.x/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor +++ /dev/null @@ -1,19 +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 artifact processor extension -org.apache.tuscany.sca.contribution.processor.xml.AnyAttributeProcessor;qname=http://www.w3.org/2001/XMLSchema#anyAttribute,model=java.lang.Object -- cgit v1.2.3