You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by as...@apache.org on 2006/10/10 09:55:49 UTC
svn commit: r454652 -
/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/PropertySerializer.java
Author: asankha
Date: Tue Oct 10 00:55:47 2006
New Revision: 454652
URL: http://svn.apache.org/viewvc?view=rev&rev=454652
Log:
Comitting for Ruwan
Modified:
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/PropertySerializer.java
Modified: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/PropertySerializer.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/PropertySerializer.java?view=diff&rev=454652&r1=454651&r2=454652
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/PropertySerializer.java (original)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/PropertySerializer.java Tue Oct 10 00:55:47 2006
@@ -23,6 +23,8 @@
import org.apache.axiom.om.OMElement;
import org.apache.synapse.config.Property;
import org.apache.synapse.SynapseException;
+import org.apache.axiom.om.impl.llom.OMTextImpl;
+import javax.xml.stream.XMLStreamConstants;
public class PropertySerializer {
@@ -41,9 +43,11 @@
*/
public static OMElement serializeProperty(Property property, OMElement parent) {
- OMElement propertyElement = fac.createOMElement("set-property", synNS);
+ OMElement propertyElement = fac.createOMElement("property", synNS);
propertyElement.addAttribute(fac.createOMAttribute(
"name", nullNS, property.getName()));
+ propertyElement.addAttribute(fac.createOMAttribute(
+ "type", nullNS, "" + property.getType()));
if (property.getType() == Property.DYNAMIC_TYPE) {
propertyElement.addAttribute(fac.createOMAttribute(
@@ -57,11 +61,15 @@
} else if (property.getType() == Property.INLINE_XML_TYPE) {
propertyElement.addChild((OMElement) property.getValue());
} else if (property.getType() == Property.INLINE_STRING_TYPE) {
- propertyElement.addChild(fac.createOMText((String) property.getValue()));
+ OMTextImpl textData = (OMTextImpl) fac.createOMText((String)property.getValue());
+ textData.setType(XMLStreamConstants.CDATA);
+ propertyElement.addChild(textData);
} else {
handleException("Property type undefined");
}
- parent.addChild(propertyElement);
+ if(parent != null) {
+ parent.addChild(propertyElement);
+ }
return propertyElement;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org