Populate data/ hierarchy
[yangtools.git] / data / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / ForeignDataNode.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;
9
10 import com.google.common.annotations.Beta;
11 import javax.xml.transform.dom.DOMSource;
12 import org.eclipse.jdt.annotation.NonNull;
13
14 /**
15  * A NormalizedNode holding a value in some foreign object model. The object model is identified by a single class,
16  * which must be the superclass of (or interface implemented by) all objects used to anchor that object model into
17  * NormalizedNode model.
18  *
19  * <p>
20  * This interface should not be implemented directly, but rather further specialized, like {@link AnyxmlNode}.
21  *
22  * @param <V> Value type, uniquely identifying the object model used for values
23  */
24 @Beta
25 public interface ForeignDataNode<V> extends DataContainerChild {
26     /**
27      * {@inheritDoc}
28      *
29      * <p>
30      * The body follows the object model exposed through {@link #bodyObjectModel()}
31      */
32     @Override
33     V body();
34
35     /**
36      * Return the object model class, which identifies it. For example {@link DOMSourceAnyxmlNode} uses
37      * {@link DOMSource} as its value object model.
38      *
39      * @return Object model class
40      */
41     @NonNull Class<V> bodyObjectModel();
42 }