}
@Override
- public void leafSetEntryNode(final Object value, final Map<QName, String> attributes) throws IOException {
- delegate().leafSetEntryNode(value, attributes);
+ public void leafSetEntryNode(final QName name, final Object value, final Map<QName, String> attributes) throws IOException {
+ delegate().leafSetEntryNode(name, value, attributes);
}
@Override
import com.google.common.collect.ForwardingObject;
import java.io.IOException;
+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;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
}
@Override
- public void leafSetEntryNode(final Object value) throws IOException {
- delegate().leafSetEntryNode(value);
+ public void leafSetEntryNode(final QName name, final Object value) throws IOException {
+ delegate().leafSetEntryNode(name, value);
}
@Override
import com.google.common.base.Strings;
import java.util.ArrayDeque;
import java.util.Deque;
+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;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
}
@Override
- public void leafSetEntryNode(final Object value) {
+ public void leafSetEntryNode(final QName name, final Object value) {
LOG.debug("{}{}({}) ", ind(), value, value.getClass().getSimpleName());
}
void leafNode(YangInstanceIdentifier.NodeIdentifier name, Object value, Map<QName, String> attributes) throws IOException;
- void leafSetEntryNode(Object value, Map<QName, String> attributes) throws IOException;
+ void leafSetEntryNode(QName name, Object value, Map<QName, String> attributes) throws IOException;
void startContainerNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint, Map<QName, String> attributes) throws IOException;
import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;
+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;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
* <li><code>leaf-list</code> - Leaf list start is emitted using
* {@link #startLeafSet(NodeIdentifier, int)}. Leaf list end is emitted using
* {@link #endNode()}. Leaf list entries are emmited using
- * {@link #leafSetEntryNode(Object)}.
+ * {@link #leafSetEntryNode(QName, Object)}.
*
* <li><code>anyxml - AN node event is emitted using
* {@link #leafNode(NodeIdentifier, Object)}. {@link #endNode()} MUST NOT BE emitted
* Emits a start of leaf set (leaf-list).
* <p>
* Emits start of leaf set, during writing leaf set event, only
- * {@link #leafSetEntryNode(Object)} calls are valid. Leaf set event is
+ * {@link #leafSetEntryNode(QName, Object)} calls are valid. Leaf set event is
* finished by calling {@link #endNode()}.
*
* @param name
* Emits a start of leaf set (leaf-list).
* <p>
* Emits start of leaf set, during writing leaf set event, only
- * {@link #leafSetEntryNode(Object)} calls are valid. Leaf set event is
+ * {@link #leafSetEntryNode(QName, Object)} calls are valid. Leaf set event is
* finished by calling {@link #endNode()}.
*
* @param name
/**
* Emits a leaf set entry node
*
+ * @param name
+ * name of the node as defined in the schema.
* @param value
* Value of leaf set entry node. Supplied object MUST BE constant over time.
* @throws IllegalArgumentException
* If node was emitted outside <code>leaf set</code> node.
* @throws IOException if an underlying IO error occurs
*/
- void leafSetEntryNode(Object value) throws IOException;
+ void leafSetEntryNode(QName name, Object value) throws IOException;
/**
*
private boolean wasProcessAsSimpleNode(final NormalizedNode<?, ?> node) throws IOException {
if (node instanceof LeafSetEntryNode) {
final LeafSetEntryNode<?> nodeAsLeafList = (LeafSetEntryNode<?>)node;
+ final QName name = nodeAsLeafList.getIdentifier().getNodeType();
if(writer instanceof NormalizedNodeStreamAttributeWriter) {
- ((NormalizedNodeStreamAttributeWriter) writer).leafSetEntryNode(nodeAsLeafList.getValue(), nodeAsLeafList.getAttributes());
+ ((NormalizedNodeStreamAttributeWriter) writer).leafSetEntryNode(name, nodeAsLeafList.getValue(),
+ nodeAsLeafList.getAttributes());
} else {
- writer.leafSetEntryNode(nodeAsLeafList.getValue());
+ writer.leafSetEntryNode(name, nodeAsLeafList.getValue());
}
return true;
} else if (node instanceof LeafNode) {
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.net.URI;
+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;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
}
@Override
- public void leafSetEntryNode(final Object value) throws IOException {
+ public void leafSetEntryNode(final QName name, final Object value) throws IOException {
final LeafListSchemaNode schema = tracker.leafSetEntryNode();
final JSONCodec<Object> codec = codecs.codecFor(schema);
context.emittingChild(codecs.getSchemaContext(), writer);
@Override
public void write(final SchemaAwareNormalizedNodeStreamWriter writer) throws IOException {
writer.nextDataSchemaNode(getSchema());
- writer.leafSetEntryNode(getValue());
+ writer.leafSetEntryNode(getSchema().getQName(), getValue());
}
}
}
@Override
- public void leafSetEntryNode(final Object value, final Map<QName, String> attributes) throws IOException {
+ public void leafSetEntryNode(final QName name, final Object value, final Map<QName, String> attributes) throws IOException {
final LeafListSchemaNode schema = tracker.leafSetEntryNode();
writeElement(schema.getQName(), schema, value, attributes);
}
}
@Override
- public void leafSetEntryNode(final Object value) throws IOException {
+ public void leafSetEntryNode(final QName name, final Object value) throws IOException {
final LeafListSchemaNode schema = tracker.leafSetEntryNode();
writeElement(schema.getQName(), schema, value);
}
import java.util.ArrayDeque;
import java.util.Collection;
import java.util.Deque;
+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;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
}
@Override
- public void leafSetEntryNode(final Object value) {
+ public void leafSetEntryNode(final QName name, final Object value) {
if (getCurrent() instanceof ImmutableOrderedLeafSetNodeBuilder) {
@SuppressWarnings("unchecked")
ListNodeBuilder<Object, LeafSetEntryNode<Object>> builder = ((ImmutableOrderedLeafSetNodeBuilder<Object>) getCurrent());
}
@Override
- public void startOrderedLeafSet(final NodeIdentifier name,final int childSizeHint) {
+ public void startOrderedLeafSet(final NodeIdentifier name, final int childSizeHint) {
checkDataNodeContainer();
final ListNodeBuilder<Object, LeafSetEntryNode<Object>> builder = Builders.orderedLeafSetBuilder();
builder.withNodeIdentifier(name);
}
@Override
- public void leafSetEntryNode(final Object value) throws IOException, IllegalArgumentException {
- delegate().leafSetEntryNode(value);
+ public void leafSetEntryNode(final QName name, final Object value) throws IOException, IllegalArgumentException {
+ delegate().leafSetEntryNode(transform(name), value);
}
@Override