2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.controller.yang.parser.builder.api;
\r
10 import java.util.ArrayList;
\r
11 import java.util.List;
\r
13 import org.opendaylight.controller.yang.common.QName;
\r
14 import org.opendaylight.controller.yang.model.api.SchemaPath;
\r
15 import org.opendaylight.controller.yang.model.api.Status;
\r
16 import org.opendaylight.controller.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
\r
19 * Basic implementation of SchemaNodeBuilder.
\r
21 public abstract class AbstractSchemaNodeBuilder implements SchemaNodeBuilder {
\r
22 protected final int line;
\r
23 protected final QName qname;
\r
24 protected Builder parent;
\r
25 protected SchemaPath schemaPath;
\r
26 protected String description;
\r
27 protected String reference;
\r
28 protected Status status = Status.CURRENT;
\r
29 protected final List<UnknownSchemaNodeBuilder> addedUnknownNodes = new ArrayList<UnknownSchemaNodeBuilder>();
\r
31 protected AbstractSchemaNodeBuilder(final int line, final QName qname) {
\r
37 public int getLine() {
\r
41 public QName getQName() {
\r
46 public Builder getParent() {
\r
51 public void setParent(final Builder parent) {
\r
52 this.parent = parent;
\r
55 public SchemaPath getPath() {
\r
59 public void setPath(SchemaPath schemaPath) {
\r
60 this.schemaPath = schemaPath;
\r
63 public String getDescription() {
\r
67 public void setDescription(String description) {
\r
68 this.description = description;
\r
71 public String getReference() {
\r
75 public void setReference(String reference) {
\r
76 this.reference = reference;
\r
79 public Status getStatus() {
\r
83 public void setStatus(Status status) {
\r
84 if (status != null) {
\r
85 this.status = status;
\r
90 public void addUnknownSchemaNode(UnknownSchemaNodeBuilder unknownNode) {
\r
91 addedUnknownNodes.add(unknownNode);
\r