Add OperationAsContainer @NonNull annotations
[yangtools.git] / yang / yang-data-util / src / main / java / org / opendaylight / yangtools / yang / data / util / LeafListNodeDataWithSchema.java
index 7f1f3e7f01fb5097cd433d3a15b7e117b165152d..9636ec0fdaddf241cb57caae05441cc122026300 100644 (file)
@@ -8,25 +8,33 @@
 package org.opendaylight.yangtools.yang.data.util;
 
 import java.io.IOException;
-import org.opendaylight.yangtools.yang.data.api.schema.stream.SchemaAwareNormalizedNodeStreamWriter;
-import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
+import org.opendaylight.yangtools.rfc7952.data.api.StreamWriterMetadataExtension;
+import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
 import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
 
-public class LeafListNodeDataWithSchema extends CompositeNodeDataWithSchema {
-    public LeafListNodeDataWithSchema(final DataSchemaNode schema) {
+/**
+ * Utility class used for tracking parser state as needed by a StAX-like parser.
+ * This class is to be used only by respective XML and JSON parsers in yang-data-codec-xml and yang-data-codec-gson.
+ *
+ * <p>
+ * Represents a YANG leaf-list node.
+ */
+public class LeafListNodeDataWithSchema extends CompositeNodeDataWithSchema<LeafListSchemaNode> {
+    public LeafListNodeDataWithSchema(final LeafListSchemaNode schema) {
         super(schema);
     }
 
     @Override
-    public void write(final SchemaAwareNormalizedNodeStreamWriter writer) throws IOException {
-        final LeafListSchemaNode schema = (LeafListSchemaNode) getSchema();
+    public void write(final NormalizedNodeStreamWriter writer, final StreamWriterMetadataExtension metaWriter)
+            throws IOException {
+        final LeafListSchemaNode schema = getSchema();
         writer.nextDataSchemaNode(schema);
         if (schema.isUserOrdered()) {
             writer.startOrderedLeafSet(provideNodeIdentifier(), childSizeHint());
         } else {
             writer.startLeafSet(provideNodeIdentifier(), childSizeHint());
         }
-        super.write(writer);
+        super.write(writer, metaWriter);
         writer.endNode();
     }
 }