You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by me...@apache.org on 2007/03/12 18:51:11 UTC

svn commit: r517306 - /incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/extensions/AbstractInstanceFactoryProviderDefinitionMarshaller.java

Author: meerajk
Date: Mon Mar 12 10:51:10 2007
New Revision: 517306

URL: http://svn.apache.org/viewvc?view=rev&rev=517306
Log:
Added abstract instance factory provider definition marshaller.

Added:
    incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/extensions/AbstractInstanceFactoryProviderDefinitionMarshaller.java   (with props)

Added: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/extensions/AbstractInstanceFactoryProviderDefinitionMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/extensions/AbstractInstanceFactoryProviderDefinitionMarshaller.java?view=auto&rev=517306
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/extensions/AbstractInstanceFactoryProviderDefinitionMarshaller.java (added)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/extensions/AbstractInstanceFactoryProviderDefinitionMarshaller.java Mon Mar 12 10:51:10 2007
@@ -0,0 +1,69 @@
+/*
+ * 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.core.marshaller.extensions;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.spi.marshaller.MarshalException;
+import org.apache.tuscany.spi.model.physical.InstanceFactoryProviderDefinition;
+
+/**
+ * Abstract marshaller for physical wire target definition.
+ * 
+ * @version $Revision$ $Date$
+ */
+public abstract class AbstractInstanceFactoryProviderDefinitionMarshaller<IFPD extends InstanceFactoryProviderDefinition> extends
+    AbstractExtensibleMarshallerExtension<IFPD> {
+
+    /**
+     * Marshalls a physical java reference definition to the xml writer.
+     */
+    public void marshal(IFPD modelObject, XMLStreamWriter writer) throws MarshalException {
+
+        try {
+            
+            QName qname = getModelObjectQName();
+            writer.writeStartElement(qname.getPrefix(), qname.getLocalPart(), qname.getNamespaceURI());
+            writer.writeNamespace(qname.getPrefix(), qname.getNamespaceURI());
+            
+            handleExtension(modelObject, writer);
+            
+            writer.writeEndElement();
+            
+        } catch (XMLStreamException ex) {
+            throw new MarshalException(ex);
+        }
+        
+    }
+
+    /**
+     * Unmarshalls a java physical reference definition from the xml reader.
+     */
+    public IFPD unmarshal(XMLStreamReader reader) throws MarshalException {
+
+        IFPD targetDefinition = getConcreteModelObject();
+        handleExtension(targetDefinition, reader);
+        return targetDefinition;
+
+    }
+
+}

Propchange: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/extensions/AbstractInstanceFactoryProviderDefinitionMarshaller.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/extensions/AbstractInstanceFactoryProviderDefinitionMarshaller.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org