Added line number to error messages.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / main / java / org / opendaylight / controller / yang / model / parser / util / RefineHolder.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.controller.yang.model.parser.util;
9
10 import java.util.ArrayList;
11 import java.util.List;
12
13 import org.opendaylight.controller.yang.model.api.MustDefinition;
14 import org.opendaylight.controller.yang.model.parser.builder.api.Builder;
15 import org.opendaylight.controller.yang.model.parser.builder.impl.UnknownSchemaNodeBuilder;
16
17 public final class RefineHolder implements Builder {
18     private final String name;
19     private final int line;
20     private String defaultStr;
21     private String description;
22     private String reference;
23     private Boolean config;
24     private Boolean mandatory;
25     private Boolean presence;
26     private MustDefinition must;
27     private Integer minElements;
28     private Integer maxElements;
29     private final List<UnknownSchemaNodeBuilder> addedUnknownNodes = new ArrayList<UnknownSchemaNodeBuilder>();
30
31     public RefineHolder(final String name, final int line) {
32         this.name = name;
33         this.line = line;
34     }
35
36     @Override
37     public int getLine() {
38         return line;
39     }
40
41     public String getDefaultStr() {
42         return defaultStr;
43     }
44
45     public void setDefaultStr(final String defaultStr) {
46         this.defaultStr = defaultStr;
47     }
48
49     public String getDescription() {
50         return description;
51     }
52
53     public void setDescription(final String description) {
54         this.description = description;
55     }
56
57     public String getReference() {
58         return reference;
59     }
60
61     public void setReference(final String reference) {
62         this.reference = reference;
63     }
64
65     public Boolean isConfig() {
66         return config;
67     }
68
69     public void setConfig(final Boolean config) {
70         this.config = config;
71     }
72
73     public Boolean isMandatory() {
74         return mandatory;
75     }
76
77     public void setMandatory(Boolean mandatory) {
78         this.mandatory = mandatory;
79     }
80
81     public Boolean isPresence() {
82         return presence;
83     }
84
85     public void setPresence(Boolean presence) {
86         this.presence = presence;
87     }
88
89     public MustDefinition getMust() {
90         return must;
91     }
92
93     public void setMust(MustDefinition must) {
94         this.must = must;
95     }
96
97     public Integer getMinElements() {
98         return minElements;
99     }
100
101     public void setMinElements(Integer minElements) {
102         this.minElements = minElements;
103     }
104
105     public Integer getMaxElements() {
106         return maxElements;
107     }
108
109     public void setMaxElements(Integer maxElements) {
110         this.maxElements = maxElements;
111     }
112
113     public String getName() {
114         return name;
115     }
116
117     public List<UnknownSchemaNodeBuilder> getUnknownNodes() {
118         return addedUnknownNodes;
119     }
120
121     public void addUnknownSchemaNode(UnknownSchemaNodeBuilder unknownNode) {
122         addedUnknownNodes.add(unknownNode);
123     }
124
125     @Override
126     public Object build() {
127         return null;
128     }
129
130 }