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;
12 import org.opendaylight.yangtools.yang.model.api.YangNode;
13 import org.opendaylight.yangtools.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
16 * Parent interface for all builder interfaces.
18 public interface Builder {
21 * Get name of module in which this node is declared.
25 String getModuleName();
28 * Set name of module in which this node is declared.
32 void setModuleName(String moduleName);
35 * Get current line in yang file.
37 * @return current line in yang file
42 * Get parent node of this node.
44 * @return parent node builder or null if this is top level node
49 * Set parent of this node.
54 void setParent(Builder parent);
57 * Add unknown node to this builder.
61 void addUnknownNodeBuilder(UnknownSchemaNodeBuilder unknownNode);
64 * Get builders of unknown nodes defined in this node.
66 * @return collection of UnknownSchemaNodeBuilder objects
68 List<UnknownSchemaNodeBuilder> getUnknownNodeBuilders();
71 * Build YANG data model node.
73 * This method should create an instance of YANG data model node. After
74 * creating an instance, this instance should be returned for each call
75 * without repeating build process.
77 * @return YANG data model node
79 Object build(YangNode parent);
81 interface Rebuildable<T extends Builder> {