Added getParent() method to DataSchemaNode and DataNodeContainer. Fixed Bugs.
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / DataNodeContainerBuilder.java
1 /*
2  * Copyright (c) 2013 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.parser.builder.api;
9
10 import java.util.Collection;
11 import java.util.Set;
12
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
15 import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
16 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
17
18 /**
19  * Interface for all yang data-node containers [augment, case, container,
20  * grouping, list, module, notification].
21  */
22 public interface DataNodeContainerBuilder extends Builder {
23
24     /**
25      * Get qname of this node.
26      *
27      * @return QName of this node
28      */
29     QName getQName();
30
31     /**
32      * Get schema path of this node.
33      *
34      * @return SchemaPath of this node
35      */
36     SchemaPath getPath();
37
38     /**
39      * Get already built child nodes.
40      *
41      * @return collection of child nodes
42      */
43     Collection<DataSchemaNode> getChildNodes();
44
45     /**
46      * Get builders of child nodes.
47      *
48      * @return collection child nodes builders
49      */
50     Set<DataSchemaNodeBuilder> getChildNodeBuilders();
51
52     /**
53      * Get child node by name.
54      *
55      * @param name
56      *            name of child to seek
57      * @return child node with given name if present, null otherwise
58      */
59     DataSchemaNodeBuilder getDataChildByName(String name);
60
61     /**
62      * Add builder of child node to this node.
63      *
64      * @param childNode
65      */
66     void addChildNode(DataSchemaNodeBuilder childNode);
67
68     void addChildNode(DataSchemaNode childNode);
69
70     /**
71      * Get already built groupings defined in this node.
72      *
73      * @return collection of GroupingDefinition objects
74      */
75     Set<GroupingDefinition> getGroupings();
76
77     /**
78      * Get builders of groupings defined in this node.
79      *
80      * @return collection of grouping builders
81      */
82     Set<GroupingBuilder> getGroupingBuilders();
83
84     /**
85      * Add builder of grouping statement to this node.
86      *
87      * @param groupingBuilder
88      */
89     void addGrouping(GroupingBuilder groupingBuilder);
90
91     /**
92      * Get builders of uses defined in this node.
93      *
94      * @return collection of uses builders
95      */
96     Set<UsesNodeBuilder> getUsesNodes();
97
98     /**
99      * Add builder of uses statement to this node.
100      *
101      * @param usesBuilder
102      */
103     void addUsesNode(UsesNodeBuilder usesBuilder);
104
105     /**
106      * Get builders of typedef statement defined in this node.
107      *
108      * @return typedefBuilder
109      */
110     Set<TypeDefinitionBuilder> getTypeDefinitionBuilders();
111
112     /**
113      * Add typedef builder to this node.
114      *
115      * @param typedefBuilder
116      */
117     void addTypedef(TypeDefinitionBuilder typedefBuilder);
118
119 }