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