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;
/**
* Create a new writer with the specified context as its root.
*
- * @param writer Output {@link XMLStreamWriter}
* @param context Associated {@link SchemaContext}.
* @return A new {@link NormalizedNodeStreamWriter}
*/
/**
* Create a new writer with the specified context and rooted in the specified schema path
*
- * @param writer Output {@link XMLStreamWriter}
- * @param context Associated {@link SchemaContext}.
+ * @param context Associated {@link SchemaContext}
+ * @param path schema path
*
* @return A new {@link NormalizedNodeStreamWriter}
*/
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);
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() {
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) {