tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r812715 - in /tuscany/branches/sca-java-1.5.1/modules: binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/ contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ implementation-widget/src/main/java/org/apa...
Date Tue, 08 Sep 2009 22:27:44 GMT
Author: lresende
Date: Tue Sep  8 22:27:43 2009
New Revision: 812715

URL: http://svn.apache.org/viewvc?rev=812715&view=rev
Log:
TUSCANY-3264 - Tyiding up how we write the schema prefix as per StAX spec

Modified:
    tuscany/branches/sca-java-1.5.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
    tuscany/branches/sca-java-1.5.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java
    tuscany/branches/sca-java-1.5.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java

Modified: tuscany/branches/sca-java-1.5.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.5.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java?rev=812715&r1=812714&r2=812715&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.5.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
(original)
+++ tuscany/branches/sca-java-1.5.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
Tue Sep  8 22:27:43 2009
@@ -134,8 +134,6 @@
     }
 
     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 @@
         	extensionProcessor.write(httpBinding.getOperationSelector(), writer);
         }
         writeEnd(writer);
-        //writer.writeEndElement();
     }
 
 

Modified: tuscany/branches/sca-java-1.5.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.5.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java?rev=812715&r1=812714&r2=812715&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.5.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java
(original)
+++ tuscany/branches/sca-java-1.5.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java
Tue Sep  8 22:27:43 2009
@@ -222,8 +222,8 @@
      * @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);
         }

Modified: tuscany/branches/sca-java-1.5.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.5.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java?rev=812715&r1=812714&r2=812715&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.5.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
(original)
+++ tuscany/branches/sca-java-1.5.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
Tue Sep  8 22:27:43 2009
@@ -33,6 +33,7 @@
 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 @@
  *
  * @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 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);
     }
 }



Mime
View raw message