Make DataTreeTip.prepare() throw a checked exception
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / stream / AnydataExtension.java
1 /*
2  * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.data.api.schema.stream;
9
10 import com.google.common.annotations.Beta;
11 import java.io.IOException;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
13
14 /**
15  * A {@link NormalizedNodeStreamWriterExtension} supporting streaming of {@code anydata} nodes.
16  *
17  * @author Robert Varga
18  */
19 @Beta
20 // FIXME: 4.0.0: integrate this into NormalizedNodeStreamWriter
21 public interface AnydataExtension extends NormalizedNodeStreamWriterExtension {
22     /**
23      * Start emitting a new anydata node identified by name.
24      *
25      * @param name The name of the anydata element
26      * @param objectModel The object model of anydata content
27      * @return True if the specified object model is supported by this extension and the process of emitting the node
28      *         has started. False if the object model is not supported and the node has not started to be emitted.
29      * @throws IOException if an underlying IO error occurs
30      */
31     boolean startAnydataNode(NodeIdentifier name, Class<?> objectModel) throws IOException;
32 }