summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.5.1/modules
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-09-08 22:27:43 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-09-08 22:27:43 +0000
commit34a6bf5aea02a1092d3eca524020f8194acfbcb3 (patch)
treee8dc17377461c8c0162a2797bed29df010d4f526 /branches/sca-java-1.5.1/modules
parentc2a7566c644a172079127381706a9aff407fc24e (diff)
TUSCANY-3264 - Tyiding up how we write the schema prefix as per StAX spec
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@812715 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5.1/modules')
-rw-r--r--branches/sca-java-1.5.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java3
-rw-r--r--branches/sca-java-1.5.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java2
-rw-r--r--branches/sca-java-1.5.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java13
3 files changed, 6 insertions, 12 deletions
diff --git a/branches/sca-java-1.5.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java b/branches/sca-java-1.5.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
index 9529a21c86..cb35d0f104 100644
--- a/branches/sca-java-1.5.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
+++ b/branches/sca-java-1.5.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
@@ -134,8 +134,6 @@ public class HTTPBindingProcessor extends BaseStAXArtifactProcessor implements S
}
public void write(HTTPBinding httpBinding, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
- //writer.writeStartElement(Constants.SCA10_NS, BINDING_HTTP);
-
writeStart(writer, BINDING_HTTP_QNAME.getNamespaceURI(), BINDING_HTTP_QNAME.getLocalPart());
//write policies
@@ -159,7 +157,6 @@ public class HTTPBindingProcessor extends BaseStAXArtifactProcessor implements S
extensionProcessor.write(httpBinding.getOperationSelector(), writer);
}
writeEnd(writer);
- //writer.writeEndElement();
}
diff --git a/branches/sca-java-1.5.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java b/branches/sca-java-1.5.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java
index a451316883..128e7695a9 100644
--- a/branches/sca-java-1.5.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java
+++ b/branches/sca-java-1.5.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java
@@ -222,8 +222,8 @@ public abstract class BaseStAXArtifactProcessor {
* @throws XMLStreamException
*/
protected void writeStart(XMLStreamWriter writer, String uri, String name, XAttr... attrs) throws XMLStreamException {
- String prefix = writeElementPrefix(writer, uri);
writer.writeStartElement(uri, name);
+ String prefix = writeElementPrefix(writer, uri);
if (prefix != null){
writer.writeNamespace(prefix,uri);
}
diff --git a/branches/sca-java-1.5.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java b/branches/sca-java-1.5.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
index 442191a568..c0087e97fe 100644
--- a/branches/sca-java-1.5.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
+++ b/branches/sca-java-1.5.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
@@ -33,6 +33,7 @@ import org.apache.tuscany.sca.assembly.xml.Constants;
import org.apache.tuscany.sca.contribution.Artifact;
import org.apache.tuscany.sca.contribution.ContributionFactory;
import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
import org.apache.tuscany.sca.contribution.service.ContributionReadException;
@@ -48,7 +49,7 @@ import org.apache.tuscany.sca.monitor.Problem.Severity;
*
* @version $Rev$ $Date$
*/
-public class WidgetImplementationProcessor implements StAXArtifactProcessor<WidgetImplementation> {
+public class WidgetImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<WidgetImplementation> {
private static final QName IMPLEMENTATION_WIDGET = new QName(Constants.SCA10_TUSCANY_NS, "implementation.widget");
private AssemblyFactory assemblyFactory;
@@ -159,17 +160,13 @@ public class WidgetImplementationProcessor implements StAXArtifactProcessor<Widg
}
public void write(WidgetImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <implementation.widget>
- // writer.setPrefix("widget",IMPLEMENTATION_WIDGET.getNamespaceURI());
- writer.writeStartElement(IMPLEMENTATION_WIDGET.getNamespaceURI(), IMPLEMENTATION_WIDGET.getLocalPart());
- writer.writeNamespace("widget",IMPLEMENTATION_WIDGET.getNamespaceURI());
-
+ // Write <implementation.widget>
+ writeStart(writer, IMPLEMENTATION_WIDGET.getNamespaceURI(), IMPLEMENTATION_WIDGET.getLocalPart());
if (implementation.getLocation() != null) {
writer.writeAttribute("location", implementation.getLocation());
}
- writer.writeEndElement();
+ writeEnd(writer);
}
}