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 SchemaPath path;
\r
25 protected String description;
\r
26 protected String reference;
\r
27 protected Status status = Status.CURRENT;
\r
28 protected final List<UnknownSchemaNodeBuilder> addedUnknownNodes = new ArrayList<UnknownSchemaNodeBuilder>();
\r
30 protected AbstractSchemaNodeBuilder(final QName qname, final int line) {
\r
36 public int getLine() {
\r
40 public QName getQName() {
\r
44 public SchemaPath getPath() {
\r
48 public void setPath(SchemaPath schemaPath) {
\r
49 this.path = schemaPath;
\r
52 public String getDescription() {
\r
56 public void setDescription(String description) {
\r
57 this.description = description;
\r
60 public String getReference() {
\r
64 public void setReference(String reference) {
\r
65 this.reference = reference;
\r
68 public Status getStatus() {
\r
72 public void setStatus(Status status) {
\r
73 if (status != null) {
\r
74 this.status = status;
\r
79 public void addUnknownSchemaNode(UnknownSchemaNodeBuilder unknownNode) {
\r
80 addedUnknownNodes.add(unknownNode);
\r