Merge "Remove use of deprecated Exceptions"
[controller.git] / opendaylight / netconf / config-netconf-connector / src / main / java / org / opendaylight / controller / netconf / confignetconfconnector / mapping / attributes / toxml / SimpleAttributeWritingStrategy.java
index 514183be2fef343b2a5f11888d9baa181e8c94de..b327f8ebeff06733fd48ba7483d938b689ef477d 100644 (file)
@@ -29,10 +29,20 @@ public class SimpleAttributeWritingStrategy implements AttributeWritingStrategy
 
     @Override
     public void writeElement(Element parentElement, String namespace, Object value) {
+        value = preprocess(value);
         Util.checkType(value, String.class);
-        Element innerNode = XmlUtil.createTextElement(document, key, (String) value);
+        Element innerNode = createElement(document, key, (String) value);
         XmlUtil.addNamespaceAttr(innerNode, namespace);
         parentElement.appendChild(innerNode);
     }
 
+    protected Element createElement(Document document, String key, String value) {
+        return XmlUtil.createTextElement(document, key, (String) value);
+    }
+
+    protected Object preprocess(Object value) {
+        return value;
+    }
+
+
 }