2 * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.codec.binfmt;
10 import com.google.common.annotations.Beta;
11 import java.io.IOException;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.eclipse.jdt.annotation.Nullable;
14 import org.opendaylight.yangtools.yang.common.QName.QNameAwareDataOutput;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
17 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
18 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
19 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
22 * Interface for emitting {@link NormalizedNode}s, {@link YangInstanceIdentifier}s, {@link PathArgument}s
23 * and {@link SchemaPath}s.
27 public interface NormalizedNodeDataOutput extends AutoCloseable, QNameAwareDataOutput {
29 void writeNormalizedNode(NormalizedNode normalizedNode) throws IOException;
31 void writePathArgument(PathArgument pathArgument) throws IOException;
33 void writeYangInstanceIdentifier(YangInstanceIdentifier identifier) throws IOException;
35 @Deprecated(forRemoval = true)
36 void writeSchemaPath(SchemaPath path) throws IOException;
38 void writeSchemaNodeIdentifier(SchemaNodeIdentifier path) throws IOException;
41 void close() throws IOException;
43 default void writeOptionalNormalizedNode(final @Nullable NormalizedNode normalizedNode) throws IOException {
44 if (normalizedNode != null) {
46 writeNormalizedNode(normalizedNode);