From b265c33bb98e03637a5c41e94cbb9ad1777b87bf Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 11 Mar 2015 10:59:11 +0100 Subject: [PATCH] BUG-1513: migrate users to ChoiceSchemaNode This migrates all users to the new interface name, cleaning them up as the data.api and model.api name clash is resolved. Change-Id: Ibdc317d5ff86c6a895cccdacf6dfea1fb005d9b6 Signed-off-by: Robert Varga --- .../xml/codec/XmlDocumentUtils.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/java/org/opendaylight/controller/xml/codec/XmlDocumentUtils.java b/java/org/opendaylight/controller/xml/codec/XmlDocumentUtils.java index 8af6a3140b..79075b38b7 100644 --- a/java/org/opendaylight/controller/xml/codec/XmlDocumentUtils.java +++ b/java/org/opendaylight/controller/xml/codec/XmlDocumentUtils.java @@ -22,7 +22,7 @@ import org.opendaylight.yangtools.yang.data.impl.SimpleNodeTOImpl; import org.opendaylight.yangtools.yang.data.impl.codec.TypeDefinitionAwareCodec; import org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlCodecProvider; import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode; -import org.opendaylight.yangtools.yang.model.api.ChoiceNode; +import org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode; import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode; import org.opendaylight.yangtools.yang.model.api.DataNodeContainer; import org.opendaylight.yangtools.yang.model.api.DataSchemaNode; @@ -76,7 +76,7 @@ public class XmlDocumentUtils { } public static final QName OPERATION_ATTRIBUTE_QNAME = QName.create(URI.create("urn:ietf:params:xml:ns:netconf:base:1.0"), null, "operation"); - private static final Logger logger = LoggerFactory.getLogger(XmlDocumentUtils.class); + private static final Logger LOG = LoggerFactory.getLogger(XmlDocumentUtils.class); private static final XMLOutputFactory FACTORY = XMLOutputFactory.newFactory(); /** @@ -107,7 +107,7 @@ public class XmlDocumentUtils { writer.close(); return (Document)result.getNode(); } catch (XMLStreamException e) { - logger.error("Failed to serialize data {}", data, e); + LOG.error("Failed to serialize data {}", data, e); return null; } } @@ -151,23 +151,23 @@ public class XmlDocumentUtils { String text = xmlElement.getTextContent(); Object value = null; if (codec != null) { - logger.debug("toSimpleNodeWithType: found codec, deserializing text {}", text); + LOG.debug("toSimpleNodeWithType: found codec, deserializing text {}", text); value = codec.deserialize(text); } final TypeDefinition baseType = XmlUtils.resolveBaseTypeFrom(schema.getType()); if (baseType instanceof InstanceIdentifierType) { - logger.debug("toSimpleNodeWithType: base type of node is instance identifier, deserializing element", xmlElement); + LOG.debug("toSimpleNodeWithType: base type of node is instance identifier, deserializing element", xmlElement); value = InstanceIdentifierForXmlCodec.deserialize(xmlElement,schemaCtx); } else if(baseType instanceof IdentityrefTypeDefinition){ - logger.debug("toSimpleNodeWithType: base type of node is IdentityrefTypeDefinition, deserializing element", xmlElement); + LOG.debug("toSimpleNodeWithType: base type of node is IdentityrefTypeDefinition, deserializing element", xmlElement); value = InstanceIdentifierForXmlCodec.toIdentity(xmlElement.getTextContent(), xmlElement, schemaCtx); } if (value == null) { - logger.debug("toSimpleNodeWithType: no type found for element, returning just the text string value of element {}", xmlElement); + LOG.debug("toSimpleNodeWithType: no type found for element, returning just the text string value of element {}", xmlElement); value = xmlElement.getTextContent(); } @@ -181,18 +181,18 @@ public class XmlDocumentUtils { String text = xmlElement.getTextContent(); Object value = null; if (codec != null) { - logger.debug("toSimpleNodeWithType: found codec, deserializing text {}", text); + LOG.debug("toSimpleNodeWithType: found codec, deserializing text {}", text); value = codec.deserialize(text); } final TypeDefinition baseType = XmlUtils.resolveBaseTypeFrom(schema.getType()); if (baseType instanceof InstanceIdentifierType) { - logger.debug("toSimpleNodeWithType: base type of node is instance identifier, deserializing element", xmlElement); + LOG.debug("toSimpleNodeWithType: base type of node is instance identifier, deserializing element", xmlElement); value = InstanceIdentifierForXmlCodec.deserialize(xmlElement,schemaCtx); } if (value == null) { - logger.debug("toSimpleNodeWithType: no type found for element, returning just the text string value of element {}", xmlElement); + LOG.debug("toSimpleNodeWithType: no type found for element, returning just the text string value of element {}", xmlElement); value = xmlElement.getTextContent(); } @@ -229,8 +229,8 @@ public class XmlDocumentUtils { for (DataSchemaNode dsn : dataSchemaNode) { if (qname.isEqualWithoutRevision(dsn.getQName())) { return Optional. of(dsn); - } else if (dsn instanceof ChoiceNode) { - for (ChoiceCaseNode choiceCase : ((ChoiceNode) dsn).getCases()) { + } else if (dsn instanceof ChoiceSchemaNode) { + for (ChoiceCaseNode choiceCase : ((ChoiceSchemaNode) dsn).getCases()) { Optional foundDsn = findFirstSchema(qname, choiceCase.getChildNodes()); if (foundDsn != null && foundDsn.isPresent()) { return foundDsn; -- 2.36.6