import org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode;
import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaNode;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.slf4j.Logger;
*/
public class SchemaOrderedNormalizedNodeWriter extends NormalizedNodeWriter {
private static final Logger LOG = LoggerFactory.getLogger(SchemaOrderedNormalizedNodeWriter.class);
- private final SchemaContext schemaContext;
+ private final EffectiveModelContext schemaContext;
private final SchemaNode root;
private SchemaNode currentSchemaNode;
* @param path
* path
*/
- public SchemaOrderedNormalizedNodeWriter(final NormalizedNodeStreamWriter writer, final SchemaContext schemaContext,
- final SchemaPath path) {
+ public SchemaOrderedNormalizedNodeWriter(final NormalizedNodeStreamWriter writer,
+ final EffectiveModelContext schemaContext, final SchemaPath path) {
super(writer);
this.schemaContext = schemaContext;
final Collection<SchemaNode> schemaNodes = SchemaUtils.findParentSchemaNodesOnPath(schemaContext, path);
@Override
public SchemaOrderedNormalizedNodeWriter write(final NormalizedNode<?, ?> node) throws IOException {
if (Objects.equals(root, schemaContext)) {
- currentSchemaNode = schemaContext.getDataChildByName(node.getNodeType());
+ currentSchemaNode = schemaContext.dataChildByName(node.getNodeType());
} else {
currentSchemaNode = root;
}
}
}
} else if (parentSchemaNode instanceof ChoiceSchemaNode) {
- for (final CaseSchemaNode ccNode : ((ChoiceSchemaNode) parentSchemaNode).getCases().values()) {
+ for (final CaseSchemaNode ccNode : ((ChoiceSchemaNode) parentSchemaNode).getCases()) {
for (final DataSchemaNode dsn : ccNode.getChildNodes()) {
if (qNameToNodes.containsKey(dsn.getQName())) {
write(qNameToNodes.get(dsn.getQName()), dsn);