Merge "Fix for Bug 497."
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / CompositeNode.java
1 /*\r
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 package org.opendaylight.yangtools.yang.data.api;\r
9 \r
10 import java.util.List;\r
11 import java.util.Map;\r
12 \r
13 import org.opendaylight.yangtools.yang.common.QName;\r
14 \r
15 /**\r
16  * Composite node represents a branch in the data tree, which could contain\r
17  * nested composite nodes or leaf nodes. In the terms of the XML the simple node\r
18  * is element which does not text data directly (CDATA or PCDATA), only other\r
19  * nodes. The composite node is the manifestation of the following data schema\r
20  * constructs in the YANG:\r
21  *\r
22  * <ul>\r
23  * <li><b>container</b> - the composite node represents the YANG container and\r
24  * could contain all children schema nodes of that container</li>\r
25  * <li><b>item</b> in the <b>list</b> - the composite node represents one item\r
26  * in the YANG list and could contain all children schema nodes of that list\r
27  * item.</li>\r
28  * <li><b>anyxml</b></li>\r
29  * </ul>\r
30  *\r
31  *\r
32  */\r
33 public interface CompositeNode extends //\r
34     Node<List<Node<?>>>, //\r
35     NodeModification, //\r
36     Map<QName,List<Node<?>>> {\r
37 \r
38     /**\r
39      * Returns a list of children as seens in resulting XML serialization\r
40      * defined by YANG specification.\r
41      *\r
42      *\r
43      * @return\r
44      */\r
45     @Deprecated\r
46     List<Node<?>> getChildren();\r
47 \r
48     List<CompositeNode> getCompositesByName(QName children);\r
49 \r
50     List<CompositeNode> getCompositesByName(String children);\r
51 \r
52     List<SimpleNode<?>> getSimpleNodesByName(QName children);\r
53 \r
54     List<SimpleNode<?>> getSimpleNodesByName(String children);\r
55 \r
56     CompositeNode getFirstCompositeByName(QName container);\r
57 \r
58     SimpleNode<?> getFirstSimpleByName(QName leaf);\r
59 \r
60     /**\r
61      * @return cast self to mutable, if possible\r
62      */\r
63     @Deprecated\r
64     MutableCompositeNode asMutable();\r
65 \r
66 }\r