Merge "BUG-1382: eliminate QName.getPrefix()"
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / codec / SchemaTracker.java
index cb7747fc6c70ea2451629b943d14fc680f5f40db..16018df8c3ad177dad6cb26166b860b628eee89f 100644 (file)
@@ -9,11 +9,14 @@ package org.opendaylight.yangtools.yang.data.impl.codec;
 
 import com.google.common.annotations.Beta;
 import com.google.common.base.Preconditions;
+
 import java.io.IOException;
 import java.util.ArrayDeque;
 import java.util.Deque;
 import java.util.HashSet;
+
 import javax.xml.stream.XMLStreamWriter;
+
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
@@ -117,7 +120,7 @@ public final class SchemaTracker {
         return schema;
     }
 
-    public void startList(final NodeIdentifier name) {
+    public void startList(final PathArgument name) {
         final SchemaNode schema = getSchema(name);
         Preconditions.checkArgument(schema instanceof ListSchemaNode, "Node %s is not a list", schema.getPath());
         schemaStack.push(schema);
@@ -136,12 +139,12 @@ public final class SchemaTracker {
         return (LeafSchemaNode) schema;
     }
 
-    public SchemaNode startLeafSet(final NodeIdentifier name) {
+    public LeafListSchemaNode startLeafSet(final NodeIdentifier name) {
         final SchemaNode schema = getSchema(name);
 
         Preconditions.checkArgument(schema instanceof LeafListSchemaNode, "Node %s is not a leaf-list", schema.getPath());
         schemaStack.push(schema);
-        return schema;
+        return (LeafListSchemaNode)schema;
     }
 
     public LeafListSchemaNode leafSetEntryNode() {
@@ -151,22 +154,22 @@ public final class SchemaTracker {
         return (LeafListSchemaNode) parent;
     }
 
-    public SchemaNode startChoiceNode(final NodeIdentifier name) {
+    public ChoiceNode startChoiceNode(final NodeIdentifier name) {
         LOG.debug("Enter choice {}", name);
         final SchemaNode schema = getSchema(name);
 
         Preconditions.checkArgument(schema instanceof ChoiceNode, "Node %s is not a choice", schema.getPath());
         schemaStack.push(schema);
-        return schema;
+        return (ChoiceNode)schema;
     }
 
-    public SchemaNode startContainerNode(final NodeIdentifier name) {
+    public ContainerSchemaNode startContainerNode(final NodeIdentifier name) {
         LOG.debug("Enter container {}", name);
         final SchemaNode schema = getSchema(name);
 
         Preconditions.checkArgument(schema instanceof ContainerSchemaNode, "Node %s is not a container", schema.getPath());
         schemaStack.push(schema);
-        return schema;
+        return (ContainerSchemaNode)schema;
     }
 
     public AugmentationSchema startAugmentationNode(final AugmentationIdentifier identifier) {