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.controller.yang.parser.util;
10 import java.util.ArrayList;
11 import java.util.List;
13 import org.opendaylight.controller.yang.model.api.MustDefinition;
14 import org.opendaylight.controller.yang.parser.builder.api.Builder;
15 import org.opendaylight.controller.yang.parser.builder.api.ConfigNode;
16 import org.opendaylight.controller.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
18 public final class RefineHolder implements Builder, ConfigNode {
19 private final String name;
20 private final int line;
21 private String defaultStr;
22 private String description;
23 private String reference;
24 private Boolean config;
25 private Boolean mandatory;
26 private Boolean presence;
27 private MustDefinition must;
28 private Integer minElements;
29 private Integer maxElements;
30 private final List<UnknownSchemaNodeBuilder> addedUnknownNodes = new ArrayList<UnknownSchemaNodeBuilder>();
32 public RefineHolder(final String name, final int line) {
38 public int getLine() {
42 public String getDefaultStr() {
46 public void setDefaultStr(final String defaultStr) {
47 this.defaultStr = defaultStr;
50 public String getDescription() {
54 public void setDescription(final String description) {
55 this.description = description;
58 public String getReference() {
62 public void setReference(final String reference) {
63 this.reference = reference;
67 public Boolean isConfiguration() {
72 public void setConfiguration(final Boolean config) {
76 public Boolean isMandatory() {
80 public void setMandatory(Boolean mandatory) {
81 this.mandatory = mandatory;
84 public Boolean isPresence() {
88 public void setPresence(Boolean presence) {
89 this.presence = presence;
92 public MustDefinition getMust() {
96 public void setMust(MustDefinition must) {
100 public Integer getMinElements() {
104 public void setMinElements(Integer minElements) {
105 this.minElements = minElements;
108 public Integer getMaxElements() {
112 public void setMaxElements(Integer maxElements) {
113 this.maxElements = maxElements;
116 public String getName() {
120 public List<UnknownSchemaNodeBuilder> getUnknownNodes() {
121 return addedUnknownNodes;
124 public void addUnknownSchemaNode(UnknownSchemaNodeBuilder unknownNode) {
125 addedUnknownNodes.add(unknownNode);
129 public Object build() {