Merge "Introduce Identifiables"
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / AnyXmlNode.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. 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 org.opendaylight.yangtools.yang.data.api.AttributesContainer;
11 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier;
12 import org.opendaylight.yangtools.yang.data.api.Node;
13
14 /**
15  * Anyxml normalizedNode.
16  *
17  * <p>
18  * This node contains values for anyxml as either SimpleNode or CompositeNode.
19  * The concrete value depends on the current value of anyxml node.
20  * </p>
21  *
22  * <p>
23  * For yang node: anyxml foo;
24  *
25  * <ul>
26  * <li>
27  * with xml value:
28  * <pre>
29  * {@code <foo>justSomeString</foo>}
30  * </pre>
31  * </li>
32  *
33  * this AnyXmlNode returns SimpleNode with QName{namespace=someNamespace, revision=someRevision, localName=foo} and value="justSomeString"
34  *
35  * <li>
36  * but with xml value:
37  * <pre>
38  * {@code <foo><bar>stringInXml</bar></foo>}
39  * </pre>
40  * </li>
41  *
42  * this AnyXmlNode returns CompositeNode with QName{}namespace=someNamespace, revision=someRevision, localName=foo}
43  * and values [SimpleNode with QName{}namespace=someNamespace, revision=someRevision, localName=bar} and value="stringInXml"]
44  * </ul>
45  * </p>
46  */
47 public interface AnyXmlNode extends AttributesContainer, DataContainerChild<NodeIdentifier, Node<?>> {
48
49     @Override
50     NodeIdentifier getIdentifier();
51
52     /**
53      * @return anyxml node value represented as SimpleNode or CompositeNode.
54      * Returned node contains top level element that duplicates the anyxml node.
55      */
56     @Override
57     Node<?> getValue();
58 }