2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.parser.builder.api;
10 import java.util.List;
11 import org.opendaylight.yangtools.concepts.Mutable;
14 * Parent interface for all builder interfaces.
16 public interface Builder extends Mutable {
19 * Returns name of module in which node created by this builder
24 String getModuleName();
27 * Get current line in yang file, on which statement
28 * associated with this builder was declared.
30 * @return current line in yang file
35 * Returns parent node builder of this node.
37 * @return parent node builder or null if this is top level node
42 * Set parent of this node.
47 void setParent(Builder parent);
50 * Adds an unknown node builder to this builder.
52 * When product (child) is builded by the {@link #build()}
53 * method, this builder is also built and unknown node is added
54 * as child to the product of this builder.
56 * @param unknownNode an unknown node builder
58 void addUnknownNodeBuilder(UnknownSchemaNodeBuilder unknownNode);
61 * Get builders of unknown nodes defined in this node.
63 * @return collection of UnknownSchemaNodeBuilder objects
65 List<UnknownSchemaNodeBuilder> getUnknownNodes();
68 * Build YANG data model node.
70 * This method should create an instance of YANG data model node. After
71 * creating an instance, this instance should be returned for each call
72 * without repeating build process.
74 * @return YANG data model node