+++ /dev/null
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.data.api.schema.stream;
-
-import java.io.IOException;
-import java.util.Map;
-import org.opendaylight.yangtools.yang.common.QName;
-
-public abstract class ForwardingNormalizedNodeStreamAttributeWriter extends ForwardingNormalizedNodeStreamWriter
- implements NormalizedNodeStreamAttributeWriter {
- @Override
- protected abstract NormalizedNodeStreamAttributeWriter delegate();
-
- @Override
- public void attributes(final Map<QName, String> attributes) throws IOException {
- delegate().attributes(attributes);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.data.api.schema.stream;
-
-import java.io.IOException;
-import java.util.Map;
-import org.opendaylight.yangtools.yang.common.QName;
-
-/**
- * Extension to the NormalizedNodeStreamWriter with attribute support.
- */
-// FIXME: remove this interface
-public interface NormalizedNodeStreamAttributeWriter extends NormalizedNodeStreamWriter {
-
- void attributes(Map<QName, String> attributes) throws IOException;
-}
if (node instanceof LeafSetEntryNode) {
final LeafSetEntryNode<?> nodeAsLeafList = (LeafSetEntryNode<?>)node;
writer.startLeafSetEntryNode(nodeAsLeafList.getIdentifier());
- if (writer instanceof NormalizedNodeStreamAttributeWriter) {
- ((NormalizedNodeStreamAttributeWriter) writer).attributes(nodeAsLeafList.getAttributes());
- }
writer.scalarValue(nodeAsLeafList.getValue());
writer.endNode();
return true;
} else if (node instanceof LeafNode) {
final LeafNode<?> nodeAsLeaf = (LeafNode<?>)node;
writer.startLeafNode(nodeAsLeaf.getIdentifier());
- if (writer instanceof NormalizedNodeStreamAttributeWriter) {
- ((NormalizedNodeStreamAttributeWriter) writer).attributes(nodeAsLeaf.getAttributes());
- }
writer.scalarValue(nodeAsLeaf.getValue());
writer.endNode();
return true;
} else if (node instanceof AnyXmlNode) {
final AnyXmlNode anyXmlNode = (AnyXmlNode)node;
writer.startAnyxmlNode(anyXmlNode.getIdentifier());
- if (writer instanceof NormalizedNodeStreamAttributeWriter) {
- ((NormalizedNodeStreamAttributeWriter) writer).attributes(anyXmlNode.getAttributes());
- }
writer.domSourceValue(anyXmlNode.getValue());
writer.endNode();
return true;
protected boolean writeMapEntryNode(final MapEntryNode node) throws IOException {
writer.startMapEntryNode(node.getIdentifier(), childSizeHint(node.getValue()));
- if (writer instanceof NormalizedNodeStreamAttributeWriter) {
- ((NormalizedNodeStreamAttributeWriter) writer).attributes(node.getAttributes());
- }
return writeChildren(node.getValue());
}
if (node instanceof ContainerNode) {
final ContainerNode n = (ContainerNode) node;
writer.startContainerNode(n.getIdentifier(), childSizeHint(n.getValue()));
- if (writer instanceof NormalizedNodeStreamAttributeWriter) {
- ((NormalizedNodeStreamAttributeWriter) writer).attributes(n.getAttributes());
- }
return writeChildren(n.getValue());
}
if (node instanceof YangModeledAnyXmlNode) {
final YangModeledAnyXmlNode n = (YangModeledAnyXmlNode) node;
writer.startYangModeledAnyXmlNode(n.getIdentifier(), childSizeHint(n.getValue()));
- if (writer instanceof NormalizedNodeStreamAttributeWriter) {
- ((NormalizedNodeStreamAttributeWriter) writer).attributes(n.getAttributes());
- }
return writeChildren(n.getValue());
}
if (node instanceof MapEntryNode) {
protected boolean writeMapEntryNode(final MapEntryNode node) throws IOException {
final NormalizedNodeStreamWriter nnWriter = getWriter();
nnWriter.startMapEntryNode(node.getIdentifier(), childSizeHint(node.getValue()));
- if (nnWriter instanceof NormalizedNodeStreamAttributeWriter) {
- ((NormalizedNodeStreamAttributeWriter) nnWriter).attributes(node.getAttributes());
- }
final Set<QName> qnames = node.getIdentifier().getKeyValues().keySet();
// Write out all the key children