Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Add message to update the schema context of the InMemoryDOMDataStore"
[controller.git]
/
opendaylight
/
netconf
/
config-netconf-connector
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
netconf
/
confignetconfconnector
/
mapping
/
attributes
/
toxml
/
SimpleIdentityRefAttributeWritingStrategy.java
diff --git
a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleIdentityRefAttributeWritingStrategy.java
b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleIdentityRefAttributeWritingStrategy.java
index 7c90355051beaee44368a52a3dc0a20f08477140..a2b8e0bfdf6b97a5cc4cdf1e361084e6be0d1078 100644
(file)
--- a/
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleIdentityRefAttributeWritingStrategy.java
+++ b/
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleIdentityRefAttributeWritingStrategy.java
@@
-14,13
+14,13
@@
import org.opendaylight.controller.netconf.confignetconfconnector.util.Util;
import org.opendaylight.controller.netconf.util.xml.XmlUtil;
import org.opendaylight.yangtools.yang.common.QName;
import org.w3c.dom.Document;
import org.opendaylight.controller.netconf.util.xml.XmlUtil;
import org.opendaylight.yangtools.yang.common.QName;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.base.Preconditions;
-import org.w3c.dom.Element;
public class SimpleIdentityRefAttributeWritingStrategy extends SimpleAttributeWritingStrategy {
public class SimpleIdentityRefAttributeWritingStrategy extends SimpleAttributeWritingStrategy {
- private static final char QNAME_SEPARATOR = ':';
private static final String PREFIX = "prefix";
/**
private static final String PREFIX = "prefix";
/**
@@
-41,13
+41,10
@@
public class SimpleIdentityRefAttributeWritingStrategy extends SimpleAttributeWr
}
@Override
}
@Override
- protected Element createElement(Document doc, String key, String value) {
+ protected Element createElement(Document doc, String key, String value
, Optional<String> namespace
) {
QName qName = QName.create(value);
QName qName = QName.create(value);
- String identity = qName.getLocalName();
- Element element = XmlUtil.createPrefixedTextElement(doc, key, PREFIX, identity);
-
+ String identityValue = qName.getLocalName();
String identityNamespace = qName.getNamespace().toString();
String identityNamespace = qName.getNamespace().toString();
- XmlUtil.addPrefixedNamespaceAttr(element, PREFIX, identityNamespace);
- return element;
+ return XmlUtil.createTextElementWithNamespacedContent(doc, key, PREFIX, identityNamespace, identityValue);
}
}
}
}