2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
3 * This program and the accompanying materials are made available under the
4 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
5 * and is available at http://www.eclipse.org/legal/epl-v10.html
7 package org.opendaylight.yangtools.yang.parser.builder.api;
10 import org.opendaylight.yangtools.yang.model.api.MustDefinition;
13 * Mutable holder for information contained in <code>refine</code>
15 * Represents a local change to node introduced by uses statement
16 * e.g. change in documentation, configuration or properties.
20 public interface RefineBuilder extends DocumentedNodeBuilder {
23 * Get value of config statement.
25 * @return value of config statement
27 Boolean isConfiguration();
30 * Set config statement to the product.
33 * @param config true if config true was set, false if config false was set.
35 void setConfiguration(Boolean config);
38 * Returns mandatory state of node or NULL if state was not refined.
41 * @return mandatory state of node or NULL if state was not refined.
43 Boolean isMandatory();
45 void setMandatory(Boolean mandatory);
49 * Returns presence state of refined container.
51 * @return Presence state of refined container.
55 void setPresence(Boolean presence);
58 * Returns <code>must</code> definition associated with this builder.
60 * @return <code>must</code> definition associated with this builder.
62 MustDefinition getMust();
65 * Adds must definition to product of this builder.
67 * @param must <code>must</code> definition which should be associated with parent node.
69 void setMust(MustDefinition must);
74 * Returns number of minimum required elements or NULL if minimum elements was not overriden.
76 * This constraint has meaning only if associated node is list or leaf-list.
78 * @return number of minimum required elements.
80 Integer getMinElements();
84 * Sets number of minimum required elements.
86 * This constraint has meaning only if associated node is list or leaf-list.
89 * number of minimum required elements.
91 void setMinElements(Integer minElements);
95 * Returns number of maximum elements or NULL if maximum elements was not overriden.
97 * This constraint has meaning only if associated node is list or leaf-list.
99 * @return number of maximum required elements.
101 Integer getMaxElements();
105 * Sets number of maximum required elements.
107 * This constraint has meaning only if associated node is list or leaf-list.
109 * @param minElements number of maximum required elements.
111 void setMaxElements(Integer maxElements);
115 * Returns string representation of path to refine target, which is relative to grouping root
117 * This string representation does not need to contain prefixes, since parent uses
118 * element introduces elements with namespace local to parent module.
120 * @return string representation of path to refine target, which is relative to grouping root
122 String getTargetPathString();
126 * Returns module (source) name in which refine statement was defined.
128 * @return module (source) name in which refine statement was defined.
130 String getModuleName();
133 * Line on which element was defined.
135 * @return Line on which element was defined.
140 * Returns list of unknown schema node builders, which are associated
141 * with refine statement.
143 * @return Set of unknown schema node builders.
145 List<UnknownSchemaNodeBuilder> getUnknownNodes();
148 * Returns string representation of default value or null, if default value was not refined.
150 * @return string representation of default value or null, if default value was not refined.
152 String getDefaultStr();